From: Peter Zijlstra <peterz@infradead.org>
To: Paul Walmsley <pwalmsley@nvidia.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Arnd Bergmann <arnd@arndb.de>,
linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bitops: fix signedness of compile-time hweight implementations
Date: Wed, 22 Jan 2014 18:47:54 +0100 [thread overview]
Message-ID: <20140122174754.GS31570@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <alpine.DEB.2.02.1401221718500.4071@utopia.booyaka.com>
On Wed, Jan 22, 2014 at 05:19:58PM +0000, Paul Walmsley wrote:
> Hi Peter, hpa, Arnd,
>
> On Wed, 18 Dec 2013, Paul Walmsley wrote:
>
> >
> > Enabling '-Wsign-compare' compiler warnings on code that includes
> > include/linux/bitops.h can generate the following warning:
> >
> > In file included from include/linux/kernel.h:10:0,
> > from <random filename>:48:
> > include/linux/bitops.h: In function ‘hweight_long’:
> > include/linux/bitops.h:77:26: error: signed and unsigned type in conditional
> > expression [-Werror=sign-compare]
> >
> > (converted to an error with -Werror)
> >
> > This is due to the use of the logical negation operator '!' in the
> > __const_hweight8 macro in include/asm-generic/bitops/const_hweight.h.
> > The use of that operator here results in a signed value.
> >
> > Fix by explicitly casting the __const_hweight8 macro expansion to
> > 'unsigned int'. While here, clean up several checkpatch.pl warnings.
> >
> > Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com>
> > Cc: H. Peter Anvin <hpa@zytor.com>
> > Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > ---
> > Intended for v3.14.
>
> Ping. Just checking to see if you have any comments on this one, or if
> you're planning to send it upstream for v3.14.
I'm not sure through which tree to send it, but just I've queued it so
it doesn't get lost again.
Also, it didn't apply as is for some reason, hit it on the head with a
hammer though.
next prev parent reply other threads:[~2014-01-22 17:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-18 13:02 [PATCH] bitops: fix signedness of compile-time hweight implementations Paul Walmsley
2014-01-22 17:19 ` Paul Walmsley
2014-01-22 17:47 ` Peter Zijlstra [this message]
2014-02-10 13:30 ` [tip:core/types] bitops: Fix " tip-bot for Paul Walmsley
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=20140122174754.GS31570@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=arnd@arndb.de \
--cc=hpa@zytor.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pwalmsley@nvidia.com \
/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