Re: [Outreachy kernel] Re: [PATCH v7] staging: xgifb: correct the multiple line dereference

From: Joe Perches
Date: Tue Feb 28 2017 - 06:30:33 EST


On Tue, 2017-02-28 at 12:24 +0100, Julia Lawall wrote:
> It's drifting a little bit from the original issue, but the whole *i thing
> is not very nice. The function is used in only one place, and the call
> looks like this:
>
> temp = XGI_AjustCRT2Rate(ModeIdIndex, RefreshRateTableIndex,
> &i, pVBInfo);
>
> immediately followed by:
>
> return RefreshRateTableIndex + i;
>
> temp is never used. Could the function be made to return a negative error
> code on failure and the updated value of i on success? The (*i) could
> become just i, which would even be a little shorter.

I don't see why not.