Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp992032imu; Thu, 13 Dec 2018 07:44:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/XGaxe5+B616HYEwdF1h2dXrw73nH7lIhLfZRA56JG02MXcogOrDmXtt6C/FVeDvPJe9zej X-Received: by 2002:a63:d10:: with SMTP id c16mr3878625pgl.382.1544715890051; Thu, 13 Dec 2018 07:44:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544715890; cv=none; d=google.com; s=arc-20160816; b=EWZq/r/vqbbVe/ejymQnuEmRnRgKYOj7pMVFsUQ9AN/rc1TLdrWz/A8o6q42uLlaKB 91ks42F0MIGH3ul1sAn5pfsggRVdZnwuFkZ0Mr7z2xlcDWuFUDp+knt9kTEg3BTQtI9b 0PoMDNYiZgU9LKPGg/c3irX9lnPCMInNS0Zv2fmbssz3d548zSFPiEsj+aq1z8MMe9/r scNhEpZ9/JFCcfVuArtq3YZkqEXL+A+FVU99zdNlcBdn7s5BmbLrf0F+Kq9PXMS3q1m5 9/sMxwsWP7EmKoZzVPXH+YJaXamBjN7MSZmPhB0k2ewP8fQM/SHKjLk9+P8j72Z0QdqT vMPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=0sReFQ8n7qWvhuUfNTfno3kajmawXzp00wSQ79xJQ/c=; b=F5Bz1fzryihYtf06FhVICeqfvBiO2MR2aGKR4xY12QjAz2CApXuqi006arFgsF2Gop 649ZHoZ+Dcc9HXYHir7KHh8F5ZmYWnvYwGZOZAWeWqFDmnTZ04uimVhwXrlqjb4oqfAh RdqdMZpWifuUdzSaCkFHPxJy9gCy3mJzO+W+BPLnit/HPXR8377ShSI2MOmivccsQxvf e2Xu3x2DZuKyPkN9YcC0aCOfSYXxUWJ7oPFeh1Mathiejutiy2jWGErmdcXykQC3Kyhb VrQqrbE3oUO8hI0GSg7Z6wb1vEQGbBK8facuDd6GuLhvMP+bkcG02BxwUo1HXBpymVh0 Ej7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=DqK5Ig91; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n28si1862811pfb.88.2018.12.13.07.44.24; Thu, 13 Dec 2018 07:44:50 -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=@synopsys.com header.s=mail header.b=DqK5Ig91; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728587AbeLMPnC (ORCPT + 99 others); Thu, 13 Dec 2018 10:43:02 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:36980 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbeLMPnC (ORCPT ); Thu, 13 Dec 2018 10:43:02 -0500 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 3100524E09A1; Thu, 13 Dec 2018 07:43:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1544715782; bh=7tASyAVQySDEh0uRDpTStWPhqTXJnQrKKFgtCmkxmqE=; h=From:To:Cc:Subject:Date:From; b=DqK5Ig91Fq+QrkLnASCBdELeU4gRaHlAnnKHDsNbuPoTJSJprJWeRl+eT76lJ3WkR qQYrfhk2arVPy4M2eTb2MewSaIRon26RAyLZ/ji5L19hEKkN1gIrM02ghCZRn1U5Xf +hLJNVatwjfT6DKRxFOwiZ8TNMN63BpWTLe0YI/1+bISEm2UeeXj8N7SCV2oMatGVQ FkLckcf3bq+jsAbdeEpO4dm+haS7snoqv3NDZ/erS4HofNbBhQmb68wOO8BBDOCq5q GhZsOKTenCt2GlJk5m9ZjqkqQVZGTgpC3E86VE/G76UuTnsIt+e46SnzEc1eI5+Oj/ 6qzUM88xfegEQ== Received: from paltsev-e7480.internal.synopsys.com (paltsev-e7480.internal.synopsys.com [10.121.3.66]) by mailhost.synopsys.com (Postfix) with ESMTP id 03E603DB2; Thu, 13 Dec 2018 07:42:59 -0800 (PST) From: Eugeniy Paltsev To: linux-snps-arc@lists.infradead.org, Vineet Gupta Cc: linux-kernel@vger.kernel.org, Alexey Brodkin , Eugeniy Paltsev Subject: [PATCH] ARC: fix __ffs return value to avoid build warnings Date: Thu, 13 Dec 2018 18:42:57 +0300 Message-Id: <20181213154257.23033-1-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.14.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 8da87feec59a..99e6d8948f4a 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.14.5