lkml.org 
[lkml]   [2018]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] arch/x86/boot: sizeof macro

* Andy Shevchenko <andy.shevchenko@gmail.com> 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?
> Or perhaps it might be an opportunity during some other changes to
> certain users...

We probably don't want to change then, and my point was that 99.8% of the current
usage is as a 'function':

triton:~/tip> git grep 'sizeof(' | wc -l
116570

triton:~/tip> git grep 'sizeof [:alnum:]' | wc -l
177

i.e. your patch moves it in the exact wrong direction.

Thanks,

Ingo

\
 
 \ /
  Last update: 2018-01-06 12:51    [W:0.064 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site