Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2282176imb; Mon, 4 Mar 2019 00:42:13 -0800 (PST) X-Google-Smtp-Source: AHgI3IYyPRVCsK40L+hNL8CXVpHklyW/XiozXbkMkma5i4jSV+ytV7n7FCtU+dtH9Q4ge4zStLaP X-Received: by 2002:aa7:8459:: with SMTP id r25mr19614773pfn.65.1551688932984; Mon, 04 Mar 2019 00:42:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551688932; cv=none; d=google.com; s=arc-20160816; b=A85q7g4mDqOCJSgAlh8D68D1GqEzrykyGTO1JlwKw0ueO51E32OdezdC1bGZKZ08MM faY+oIUZIsBBMjCMUtKzCydNxyDaOw2NCn9uVG3FpjSH7R4/rd1VZ2lKwBsc03kwO+kJ M7JuFhDqr5A3loakAWqdwVa3q4FdxYLBrE4h4epAOO3CDJloDEAJqdXwjEOHF+6WWIpm iXnDg3+6Y3Q5IXOkeHeg2h5jOg9LeYaWYO3CKGFlzbFzGaZc0JfDRQd3XATPIIcH+sAF TmAQDJCGK+CMyermw3b+vduJlBVMgTxCYeYMHyVmm4MYHuqgVtLniM7WGrtodgwMqOBS 3jXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=q7zSAgqbWceY7ZOliZd3A3ac4R4MCHlIdKl3tLCy9QE=; b=p9ooc+OqWFn0Ep+jehDoTMyx+Sl8j4/UDWulAgJul9IkZcPG8GWlwOrqGADKjMPvBw gLl08dZ1pmqBgB9VVRigqSr+ugGadG9HLHBFmco+q1ZZnu6gka2cXjACp9tQD9b39gy+ tq3kw6ivrVzwQej/q5DRjzZ68hz8hmPC6BwI9uWQGiqsTVtSt882Uiw02UxErVnykw0w 4ECUUDqCGT5x2XvqIwW78qvInv7zjIteYtZtvPPwQTZcRgb3r6kcgSVFsXAkGiS8IqL5 K6ukVAwXwZSMb90/INf8sRDYr1xaqR/HH1BjYhGf5jR0pZHXjRQe6gSbO+MyzGFnTdO1 ZKWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0NZ0AqWQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si4661530pgo.394.2019.03.04.00.41.58; Mon, 04 Mar 2019 00:42:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0NZ0AqWQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728172AbfCDIkI (ORCPT + 99 others); Mon, 4 Mar 2019 03:40:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:37542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726435AbfCDIdM (ORCPT ); Mon, 4 Mar 2019 03:33:12 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0D28F20823; Mon, 4 Mar 2019 08:33:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551688391; bh=nmYsrNqggNzbbY1Vip6CwIbcERnkAct8cbJeMSV0P1k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0NZ0AqWQteQxkHcmPvqwTTXqnM7Onmnl4C6tkm8rWwwIRJhmUmMc95ezjJWoJcPHs 21xgw6JMBWJJUL6K3uvpLyrnohrop9quSJ5iaSDAbRssgDmS4RYunYci1znQKzdz5P UwdYb5rpSHElSKkTcB75P832sOPkAQmkQGJu/zV8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eugeniy Paltsev , Vineet Gupta , Sasha Levin Subject: [PATCH 4.20 30/88] ARC: fix __ffs return value to avoid build warnings Date: Mon, 4 Mar 2019 09:22:13 +0100 Message-Id: <20190304081631.793778354@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190304081630.610632175@linuxfoundation.org> References: <20190304081630.610632175@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 4e868f8419cb4cb558c5d428e7ab5629cef864c7 ] | CC mm/nobootmem.o |In file included from ./include/asm-generic/bug.h:18:0, | from ./arch/arc/include/asm/bug.h:32, | from ./include/linux/bug.h:5, | from ./include/linux/mmdebug.h:5, | from ./include/linux/gfp.h:5, | from ./include/linux/slab.h:15, | from mm/nobootmem.c:14: |mm/nobootmem.c: In function '__free_pages_memory': |./include/linux/kernel.h:845:29: warning: comparison of distinct pointer types lacks a cast | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) | ^ |./include/linux/kernel.h:859:4: note: in expansion of macro '__typecheck' | (__typecheck(x, y) && __no_side_effects(x, y)) | ^~~~~~~~~~~ |./include/linux/kernel.h:869:24: note: in expansion of macro '__safe_cmp' | __builtin_choose_expr(__safe_cmp(x, y), \ | ^~~~~~~~~~ |./include/linux/kernel.h:878:19: note: in expansion of macro '__careful_cmp' | #define min(x, y) __careful_cmp(x, y, <) | ^~~~~~~~~~~~~ |mm/nobootmem.c:104:11: note: in expansion of macro 'min' | order = min(MAX_ORDER - 1UL, __ffs(start)); Change __ffs return value from 'int' to 'unsigned long' as it is done in other implementations (like asm-generic, x86, etc...) to avoid build-time warnings in places where type is strictly checked. As __ffs may return values in [0-31] interval changing return type to unsigned is valid. Signed-off-by: Eugeniy Paltsev Signed-off-by: Vineet Gupta Signed-off-by: Sasha Levin --- arch/arc/include/asm/bitops.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arc/include/asm/bitops.h b/arch/arc/include/asm/bitops.h index 8da87feec59aa..99e6d8948f4ac 100644 --- a/arch/arc/include/asm/bitops.h +++ b/arch/arc/include/asm/bitops.h @@ -340,7 +340,7 @@ static inline __attribute__ ((const)) int __fls(unsigned long x) /* * __ffs: Similar to ffs, but zero based (0-31) */ -static inline __attribute__ ((const)) int __ffs(unsigned long word) +static inline __attribute__ ((const)) unsigned long __ffs(unsigned long word) { if (!word) return word; @@ -400,9 +400,9 @@ static inline __attribute__ ((const)) int ffs(unsigned long x) /* * __ffs: Similar to ffs, but zero based (0-31) */ -static inline __attribute__ ((const)) int __ffs(unsigned long x) +static inline __attribute__ ((const)) unsigned long __ffs(unsigned long x) { - int n; + unsigned long n; asm volatile( " ffs.f %0, %1 \n" /* 0:31; 31(Z) if src 0 */ -- 2.19.1