From patchwork Tue Jul 7 09:56:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Klauser X-Patchwork-Id: 1324347 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=distanz.ch Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=fkTQ2Mb5; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B1NgP60qPz9s1x for ; Tue, 7 Jul 2020 23:33:37 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=mQ2dt7c1uK3QXP8SuXOB4KLyZYWhsbJ5h7Y8ErWg0Qs=; b=fkTQ2Mb5mpP984cfqLDcAIerQD 19W2cdGQkgbdJWrGEDx5/o6iKSm4cAjf/UyNWfRih1zivv4o9DtAtA7G8oQKoR5oV4RIb/xAy8jac WsEeqLT+7f/6dQ443QZRn01tWxGPfVEjZH2IPh9W/jiJ1//klLRHQnbcbv0Y8yS4JjYBnbGSa8xSD pQTksnMA/AQBfClzvpeLmVyfWtyFGwpfnIG2Bm9JBKUbMnKJzZGUnQ7N+Nn1r+PfaD0huQF0oKLpC 9JSucetA3m+n4iXvOU56j2Gz4PSmStsVx/6yp6CDxdS4xvaq87Ln+eXJ0IbmE/XE7Sji/3k3cr+RE 6ZWAmJng==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jsnj1-0003cR-Cb; Tue, 07 Jul 2020 13:33:31 +0000 Received: from sym2.noone.org ([178.63.92.236]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jskLU-0002Lw-43 for opensbi@lists.infradead.org; Tue, 07 Jul 2020 09:57:01 +0000 Received: by sym2.noone.org (Postfix, from userid 1002) id 4B1HsM5qctzvjc1; Tue, 7 Jul 2020 11:56:55 +0200 (CEST) From: Tobias Klauser To: opensbi@lists.infradead.org Subject: [PATCH] include: sbi_bitops: Remove dead shift assignment in ffs/fls Date: Tue, 7 Jul 2020 11:56:55 +0200 Message-Id: <20200707095655.12880-1-tklauser@distanz.ch> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200707_055700_275708_B6D6171F X-CRM114-Status: UNSURE ( 6.37 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.3 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Mailman-Approved-At: Tue, 07 Jul 2020 09:33:30 -0400 X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The value assigned to x by the shift assignment in the last if block of ffs/fls is never read. Remove it. Signed-off-by: Tobias Klauser Reviewed-by: Anup Patel --- include/sbi/sbi_bitops.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/include/sbi/sbi_bitops.h b/include/sbi/sbi_bitops.h index d920086789de..879430d4b903 100644 --- a/include/sbi/sbi_bitops.h +++ b/include/sbi/sbi_bitops.h @@ -66,10 +66,8 @@ static inline int ffs(int x) x >>= 2; r += 2; } - if (!(x & 1)) { - x >>= 1; + if (!(x & 1)) r += 1; - } return r; } @@ -148,10 +146,8 @@ static inline int fls(int x) x <<= 2; r -= 2; } - if (!(x & 0x80000000u)) { - x <<= 1; + if (!(x & 0x80000000u)) r -= 1; - } return r; }