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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170131222707.GA5919@htj.duckdns.org>
Date:   Tue, 31 Jan 2017 17:27:07 -0500
From:   Tejun Heo <tj@...nel.org>
To:     Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        dougmill@...ux.vnet.ibm.com
Subject: Re: [GIT PULL] percpu fix for v4.10-rc6

On Tue, Jan 31, 2017 at 02:17:10PM -0800, Linus Torvalds wrote:
> Because there definitely have been users of the bitop routines that
> assign the result to an "int", and I have some dim memory of us also
> having had things like drivers that made their own "bool" variables
> and use "char" for them.
> 
> But I'm not seeing it. The generic bitop pattern seems to be
> 
>     static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
>     ...
>         return (old & mask) != 0;
> 
> which is fine.
> 
> Just exactly what code did you look at?

My bad.  I misread the generic test_bit() code and was reading the
inner helper of ppc, DEFINE_TESTOP macro, which returns the masked
value.  We used to have this problem, right?  I seem to have a memory
of hitting this issue.

Is there a reason we don't make these functions explicitly return
bool?  To avoid unnecessary boolean conversion by the compiler?  If
so, there gotta be a way to avoid that.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ