From: Javi Merino <javi.merino@arm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] smp: harmonize prototypes of smp functions
Date: Wed, 18 Sep 2013 09:35:46 +0100 [thread overview]
Message-ID: <20130918083546.GA2976@e102654-lin.cambridge.arm.com> (raw)
In-Reply-To: <20130917142228.0cb08371ea5259ca53055fe4@linux-foundation.org>
On Tue, Sep 17, 2013 at 10:22:28PM +0100, Andrew Morton wrote:
> On Mon, 2 Sep 2013 15:33:13 +0100 Javi Merino <javi.merino@arm.com> wrote:
>
> > Avoid unnecessary casts from int to bool in smp functions. Some
> > functions in kernel/smp.c have a wait parameter that can be set to one
> > if you want to wait for the command to complete. It's defined as bool
> > in a few of them and int in the rest. If a function with wait
> > declared as int calls a function whose prototype has wait defined as
> > bool, the compiler needs to test if the int is != 0 and change it to 1
> > if so. This useless check can be avoided if we are consistent and
> > make all the functions use the same type for this parameter.
>
> Yes, that's a problem with bool.
>
> But the `wait' argument *is* a boolean and switching everything over to
> use "bool" (instead of "int") should provide similar code-size savings.
> Did you evaluate that approach?
I did; you get exactly the same code-size savings. But then I read
this[0] and thought that "int" was preferred.
[0] https://lkml.org/lkml/2013/8/31/138
I can submit the "bool" patch instead if you prefer it. Cheers,
Javi
prev parent reply other threads:[~2013-09-18 8:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-02 14:33 Javi Merino
2013-09-17 21:22 ` Andrew Morton
2013-09-18 8:35 ` Javi Merino [this message]
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=20130918083546.GA2976@e102654-lin.cambridge.arm.com \
--to=javi.merino@arm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.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
all inboxes | Powered by JetHome®