lkml.org 
[lkml]   [2023]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: linux-6.3-rc6/lib/maple_tree.c: Two style issues
* David Binderman <dcb314@hotmail.com> [230417 10:23]:
> Hello there,
>
> >It should be fine here.
>
> Perhaps I have been slightly less than clear. The discussion is about the *style*
> of the code, *not* whether it works or not. My apologies for the lack of clarity.
>
> Expression is
>
> while (A &&
> B && C)
>
> The static analyser notices it is poor style to have B do a limit check, but have A use it.
> Sure its working code, but suggest new code
>
> while (B && A && C)
>
> It won't make much difference to the code, it will merely be better style.
>
> 2.
>
> >> Source code is
> >>
> >>             memset(pivs + tmp, 0,
> >>                     sizeof(unsigned long *) * (max_p - tmp));
>
> >It's not good here, I can fix it.
>
> sizeof( pivs[ 0]) is a better thing to say than sizeof( unsigned long).
> There is reduced future maintenance burden, when the type of *pivs changes.
>

If you want to make the code better, then send a patch. It is very
frustrating to try and decode a compilers output over email and be told
it wasn't decoded to your liking.

This is far more of a maintenance burden than the code you are trying to change.

\
 
 \ /
  Last update: 2023-04-17 17:00    [W:0.061 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site