The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Ingo Molnar <mingo@kernel.org>
Cc: Saidgani Musaev <cpu808694@gmail.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	x86@kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] arch/x86/boot: sizeof macro
Date: Sun, 31 Dec 2017 08:33:09 -0800	[thread overview]
Message-ID: <1514737989.1967.24.camel@perches.com> (raw)
In-Reply-To: <CAHp75VdhZqRdRb2GJd4QnRoG6brYvfswZ6wR_pWEk+T-uJ3i5A@mail.gmail.com>

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.

  reply	other threads:[~2017-12-31 16:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-29 18:30 [PATCH] arch/x86/boot: sizeof macro Saidgani Musaev
2017-12-29 18:41 ` Andy Shevchenko
2017-12-29 19:34   ` hacku
2017-12-29 19:46   ` Ingo Molnar
2017-12-31 11:48     ` Andy Shevchenko
2017-12-31 16:33       ` Joe Perches [this message]
2018-01-06 11:50       ` Ingo Molnar
2018-01-08 21:44         ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1514737989.1967.24.camel@perches.com \
    --to=joe@perches.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=cpu808694@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox