From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761542AbcIXJP2 (ORCPT ); Sat, 24 Sep 2016 05:15:28 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:35010 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752427AbcIXJP0 (ORCPT ); Sat, 24 Sep 2016 05:15:26 -0400 Date: Sat, 24 Sep 2016 10:15:15 +0100 From: Russell King - ARM Linux To: Seung-Woo Kim Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, aryabinin@virtuozzo.com, arnd@arndb.de Subject: Re: UBSAN: Undefined behaviour in ./arch/arm/include/asm/bitops.h Message-ID: <20160924091515.GD1041@n2100.armlinux.org.uk> References: <1474519757-10228-1-git-send-email-sw0312.kim@samsung.com> <57E604ED.6000408@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57E604ED.6000408@samsung.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 24, 2016 at 01:45:33PM +0900, Seung-Woo Kim wrote: > With the patch "arm: ubsan: select ARCH_HAS_UBSAN_SANITIZE_ALL", I got > following UBSAN warning on Exynos5422 SoC board. Well, the simple solution is to have fls() and ffs() take unsigned int arguments rather than ints - but the question that brings up is: why do both of these take signed ints? It seems at least to me that it would be more sensible for these to take unsigned int, or even unsigned long like the other bitops do. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.