From patchwork Sat Jul 21 03:28:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 10538583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 859C1604D3 for ; Sat, 21 Jul 2018 03:28:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6904A292B7 for ; Sat, 21 Jul 2018 03:28:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AEA629360; Sat, 21 Jul 2018 03:28:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 226B6292B7 for ; Sat, 21 Jul 2018 03:28:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727041AbeGUETf (ORCPT ); Sat, 21 Jul 2018 00:19:35 -0400 Received: from merlin.infradead.org ([205.233.59.134]:46570 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726997AbeGUETe (ORCPT ); Sat, 21 Jul 2018 00:19:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Subject:From:Cc:To:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=5Qp2jh889yvdk+j4ZAqNBNaX/aSFM2S+2qivQ5jXdfQ=; b=nin1SMbBCky2YF4GRn148KzczV oCD8Orat0zZ23eeo0m6zfx0fwp5AJozTn32AZA5yjuLCA19BDK4lqrwOk522MBdHmEqPH+I3TkVhq ujKyvNhM6TelqzKcqOOOsunI3jL49T9SIRmdtimbbn2kAxeewhCrGyMoq/MExIRUNzJSQQaJuNxm3 EQFYqnKhDR5ePSNxgSyMw9DyOp63Nj8btzMOU8Kv9lzlDHtebjYqE3kKbQXFDwm43rs3GWvh2svEC FlGfmgRYQDI/0w73sUcQxUaTjdPJOqckTC3RDx10cuGCx0VWYwPUuTz3yPtYdkRDBgsS5rt4BzKYO mY5Nn1Hg==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=dragon.dunlab) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fgiZG-0001OC-2G; Sat, 21 Jul 2018 03:28:28 +0000 To: LKML , Yoshinori Sato Cc: Rich Felker , linux-sh@vger.kernel.org From: Randy Dunlap Subject: [PATCH] arch/h8300: modify ffs(), fls() etc. functions to return int Message-ID: <1cdcd8e1-b12c-31cb-1188-c062dae3e461@infradead.org> Date: Fri, 20 Jul 2018 20:28:24 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Language: en-US Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Randy Dunlap Building drivers/mtd/nand/raw/nandsim.c on arch/hexagon/ produces a printk format build warning. This is due to hexagon's ffs() being coded as returning long instead of int. Fix the printk format warning by changing all of hexagon's ffx() and flx() functions to return int instead of long. The variables that they return are already int instead of long. ../drivers/mtd/nand/raw/nandsim.c: In function 'init_nandsim': ../drivers/mtd/nand/raw/nandsim.c:760:2: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'long int' [-Wformat] There are no ffx() or flx() allmodconfig build errors after making this change. Signed-off-by: Randy Dunlap Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org --- arch/hexagon/include/asm/bitops.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- linux-next-20180717.orig/arch/hexagon/include/asm/bitops.h +++ linux-next-20180717/arch/hexagon/include/asm/bitops.h @@ -194,7 +194,7 @@ static inline int __test_bit(int nr, con * * Undefined if no zero exists, so code should check against ~0UL first. */ -static inline long ffz(int x) +static inline int ffz(int x) { int r; @@ -211,7 +211,7 @@ static inline long ffz(int x) * This is defined the same way as ffs. * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. */ -static inline long fls(int x) +static inline int fls(int x) { int r; @@ -232,7 +232,7 @@ static inline long fls(int x) * the libc and compiler builtin ffs routines, therefore * differs in spirit from the above ffz (man ffs). */ -static inline long ffs(int x) +static inline int ffs(int x) { int r; @@ -254,7 +254,7 @@ static inline long ffs(int x) * bits_per_long assumed to be 32 * numbering starts at 0 I think (instead of 1 like ffs) */ -static inline unsigned long __ffs(unsigned long word) +static inline int __ffs(unsigned long word) { int num; @@ -272,7 +272,7 @@ static inline unsigned long __ffs(unsign * Undefined if no set bit exists, so code should check against 0 first. * bits_per_long assumed to be 32 */ -static inline unsigned long __fls(unsigned long word) +static inline int __fls(unsigned long word) { int num;