Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754965AbaAVRsS (ORCPT ); Wed, 22 Jan 2014 12:48:18 -0500 Received: from merlin.infradead.org ([205.233.59.134]:35852 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752695AbaAVRsN (ORCPT ); Wed, 22 Jan 2014 12:48:13 -0500 Date: Wed, 22 Jan 2014 18:47:54 +0100 From: Peter Zijlstra To: Paul Walmsley Cc: "H. Peter Anvin" , Arnd Bergmann , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bitops: fix signedness of compile-time hweight implementations Message-ID: <20140122174754.GS31570@twins.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 :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 > > Cc: H. Peter Anvin > > Cc: Peter Zijlstra > > Cc: Arnd Bergmann > > --- > > 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/