lkml.org 
[lkml]   [2017]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] arch/x86/boot: sizeof macro
From
Date
On Sun, 2017-12-31 at 13:48 +0200, Andy Shevchenko wrote:
> On Fri, Dec 29, 2017 at 9:46 PM, Ingo Molnar <mingo@kernel.org> wrote:
> > * Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > > > - ireg.cx = sizeof buf;
> > > > + ireg.cx = sizeof(buf);
> > >
> > > sizeof is operator, not a function.
> > > So, what are you trying to achieve?
> >
> > That's true, but in the kernel coding style we use it as a function:
>
> Yeah, the question is do we need to change all those 177 occurrences at all?

There's actually around 900, for ~100:1 ratio

$ git grep -P "\bsizeof\s+\w" -- "*.[ch]" | wc -l
907
$ git grep -P "\bsizeof\s*\(" -- "*.[ch]" | wc -l
117203

About half of these occurrences are in 3 paths
and their actual uses of sizeof without and with
parenthesis are:

drivers/infiniband/ 212:3696
drivers/media/ 111:5058
drivers/usb/ 121:2006

> Or perhaps it might be an opportunity during some other changes to
> certain users...

Perhaps best that way.

\
 
 \ /
  Last update: 2017-12-31 17:34    [W:0.059 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site