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

Joe Perches joe at perches.com
Tue Feb 28 11:29:53 UTC 2017


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.


More information about the devel mailing list