lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 18 Sep 2013 09:35:46 +0100
From:	Javi Merino <javi.merino@....com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] smp: harmonize prototypes of smp functions

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@....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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ