Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp668170img; Fri, 22 Mar 2019 06:14:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwuo3MCMBAhj8fucoaGAiT4xJuFRJGtwF86T76bqQJ3yRc06oiL6NED04qucbIMswLtk65y X-Received: by 2002:a63:cd10:: with SMTP id i16mr8535044pgg.90.1553260477616; Fri, 22 Mar 2019 06:14:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553260477; cv=none; d=google.com; s=arc-20160816; b=AF+g+LdGGonXQcZ2XwbXG4Hb7oDbvAkdQ+i8HZ2/vlzlB4TZdZgJar+9W67ipex+VJ 9ED3bOHDRQoaqnYQjBYHMywNzSBO58p66J4lLaBlSJR8fVJR9wR2mQuAgFjh7iIEB9Qu r5GvSErgmp8PBlJ5kb/DkqUzzA08HSJEY33kijIaHnwCV2jyjm00jHTjJXKQNvS8deYh X2IgYsdP91mqDp/+F/asbyEqxovx0clR2xaWUsAImdSuzP586BOuCyeddfHr8lXW7EQj 9qWgyUksDrs5vhf4C1W/jy1MryY/hujNJByMXQrLMB+dGrX83pWq9vt77ho0g/5Ogbwv nd2g== 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=qOvEU/y0LVoel1utWZnDrs5HQHnvFuMX7Wy4Dc2Fp6w=; b=1EaT8giZLDb+OUx3/m0u+0EEw0RqnrBSNdlsbaGh5HbPg87e6GvuG05Kdc0I59qN/f 5Lim2EgSgZBXfjSS3/AvizHpm3Se1EoGXI4gf+NDng+8AhuSu7QjXKNuhUDfaqtgbBzm bHS6JdgL733aIRSAIbQ77PXyaO5AeBtZFnFbfrggeSAa0AKuHIptxZkUo+4cRBed+ASX wzkViUD6KNpRtJeH/0VQP6mlqCfO6LDRNgi5/RF2SdZ/HN+b2jHemp1TmqyDmtA3WG7d hpXFYk4jbgMIAIIw7Zn33sZVX5vbwklYwWi/5/ecr8MlRbYNvCOmlzKDlqd8xh6rBqMh +aLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1rIndEZF; 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 m68si7023895pfb.33.2019.03.22.06.14.22; Fri, 22 Mar 2019 06:14:37 -0700 (PDT) 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=1rIndEZF; 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 S1729923AbfCVLaN (ORCPT + 99 others); Fri, 22 Mar 2019 07:30:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:58140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729888AbfCVLaL (ORCPT ); Fri, 22 Mar 2019 07:30:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 48FF320449; Fri, 22 Mar 2019 11:30:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553254210; bh=4NRlzDN5xczftzgnkYcP521MITiceK0edatCMwnHNGg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1rIndEZF+H4rEVCjpxKz47JiYBhQJ9mD464AHNpmLXd875KgDVj+M7jolUgC/vld/ uBc6MrekQVbZG6sWt/blDIyYEGd8pRfNVo76O8KE+f67k4b2Ba5uZ4PWgSg0Rmk2tT BxQuhRVdLEW1k4evsV0eRoejAs82iprzYOctA3os= 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.4 040/230] ARC: fix __ffs return value to avoid build warnings Date: Fri, 22 Mar 2019 12:12:58 +0100 Message-Id: <20190322111239.514756485@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111236.796964179@linuxfoundation.org> References: <20190322111236.796964179@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.4-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 0352fb8d21b99..9623ae002f5b4 100644 --- a/arch/arc/include/asm/bitops.h +++ b/arch/arc/include/asm/bitops.h @@ -286,7 +286,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; @@ -346,9 +346,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