Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2359482pxb; Sun, 24 Apr 2022 12:12:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/VHLEHYKuM1AFqoT+V0BvrSmy/qOlYfrFo51hsxbrwE22EKvv33da3FKZaCInxkzm+nFe X-Received: by 2002:a50:c3cf:0:b0:41d:5fc4:7931 with SMTP id i15-20020a50c3cf000000b0041d5fc47931mr15758674edf.244.1650827558683; Sun, 24 Apr 2022 12:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650827558; cv=none; d=google.com; s=arc-20160816; b=Mi9R61HEVouBhCHrPf9zN6ILtTnJULyN2rW+o9bEHLBVokN1zxBJEPnLEgSTIDxH/f eIAgaBhw3P9PVIUcyB/hbbOhQOr5IOiFfVavMZN1XL1c/g7y/mIel+0r34Pz7qnwl7N1 jT/qn/dw/7jwZwvS8BM4IQbjWG164sYT9SK8IDaH1WOTWFq8TqrWkTz1++LPqN+JJdSU IlpScLtT543vRbZS/ezk25Hiu3RE7hAUmHjvOXyrK5Smp+Kg01UvT8CK1BDs+y6P4xha yLO2CYk+z6KTbSMBfaorFoU35lb27gSd1/F3xEoWrW5bBKNSp99qQhOyquNK3n+jfQj0 es8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=wT0yCkCPfUh9wJVGH/cyL5YlmE2FY+B2AtzYeQRFBe8=; b=oXE1YMue/vXqsdGqnHnKsX8zk/Jc4R7kS6g5YH3im01bh9WY7D6qflynWDacwyte9Q yNZ4gTEBonrTXBYhYR8m4rnra9jxIq47hC/p54ablnpO/WnZJ3GA7KXB/3/8C52HfF/z oInARGLottwAS4f3Vq5vBErl5QsKmeQnTVy1aBGSVOKkSq/NbhPbX7FQXkccSium/Hww mMlPq/9VIxP6leqVOpq+6i0/tW1ntZAUIBamI5SC7MuGh3NMHT/qn29Y00E0AVmYtdoE dc3fZH+w3ekSjkr+i1VmlgnvnoZTrt7QsY1qpcLlXCIh2R19HEVvNBY39LJz5apGdZC/ /sqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PBRNOBsp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i3-20020a170906a28300b006e89f7f73eesi11764068ejz.66.2022.04.24.12.12.14; Sun, 24 Apr 2022 12:12:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PBRNOBsp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237057AbiDXSZd (ORCPT + 99 others); Sun, 24 Apr 2022 14:25:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229929AbiDXSZb (ORCPT ); Sun, 24 Apr 2022 14:25:31 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD61935DFC; Sun, 24 Apr 2022 11:22:29 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id e2so11661463wrh.7; Sun, 24 Apr 2022 11:22:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wT0yCkCPfUh9wJVGH/cyL5YlmE2FY+B2AtzYeQRFBe8=; b=PBRNOBspxhZH6xkWDOVGcD03fAg9QSzA1SVbhHueRaV9B0/ta7fzOXc3vRDfgowf/u wL4jkSX3CF8Mp83GhbUT3zNIdfM9Cw2dwB0LvJrPjygAVM23pvT1L0yd/LGK/QpJEWL5 lFTqpE7uJr0y/j5ucF9FnnGdA6fMjRlOu/l9bdvSsAAwh7sXs7u8JNjNUpI7ttS8JM/Y w4O7nGAmu9W3SCKRoZtvH6n774nvi/DnmUjJJ8XGCCNewrRPwby/XIf6UcjyQZ2IICYa 9VA2jFJtwZ9piMTeRAw4FuUCBFusghFperqQ/9f+RJ2REhpIygGbvt3QMojnLI2JIjqV /FtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wT0yCkCPfUh9wJVGH/cyL5YlmE2FY+B2AtzYeQRFBe8=; b=TPuiraGCstj9pnrAmNcej8oXrp2GnP6Oqy8CUDC1ey1iDkVtnp49HaMNATSXvnFG5A 74lb0xHsvWvBm5xKx+DPhmkk17EF+ShzbRvr9+92OJJ07HPLU8w81038mfE1tligAk5J ow83NKA6Jj9SfQnZpxDtL5E3JDiwZEBIrA1dvviaVm7vuRuiethxmp/G+TEMPchoXpnA eIXWeicXgAg6P/4NS834i/9qgIhp21RA07oKvXuAPFMyypmBf9cFyClYT9PMMVAUICt/ MksWAzCP5CUQp2rndj+caEM7SD+FQnd694MvmFJSA23FiGkh0zHVqeoerWANvDuJm+gZ UgOA== X-Gm-Message-State: AOAM532oCWJXjSXQpEbsQYjjEdXCDiQwc5ILfd+AK4FuKnqDpFf+bage 7lkgkrlxun0D2rrxbF2Sf3E= X-Received: by 2002:a5d:64a4:0:b0:20a:d322:9765 with SMTP id m4-20020a5d64a4000000b0020ad3229765mr5931891wrp.536.1650824548232; Sun, 24 Apr 2022 11:22:28 -0700 (PDT) Received: from localhost (cpc154979-craw9-2-0-cust193.16-3.cable.virginm.net. [80.193.200.194]) by smtp.gmail.com with ESMTPSA id az30-20020a05600c601e00b0038ebd950caesm6854328wmb.30.2022.04.24.11.22.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Apr 2022 11:22:27 -0700 (PDT) From: Colin Ian King To: Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] clk: mux: remove redundant initialization of variable width Date: Sun, 24 Apr 2022 19:22:27 +0100 Message-Id: <20220424182227.1364966-1-colin.i.king@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Variable width is being ininitialized with a value that is never read. The ininitializtion is redundant and can be removed. Move the variable to the scope it is required. Cleans up cppcheck warning: Variable 'width' is assigned a value that is never used. Signed-off-by: Colin Ian King --- drivers/clk/clk-mux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index 214045f6e989..fa817c317c2a 100644 --- a/drivers/clk/clk-mux.c +++ b/drivers/clk/clk-mux.c @@ -157,11 +157,11 @@ struct clk_hw *__clk_hw_register_mux(struct device *dev, struct device_node *np, struct clk_mux *mux; struct clk_hw *hw; struct clk_init_data init = {}; - u8 width = 0; int ret = -EINVAL; if (clk_mux_flags & CLK_MUX_HIWORD_MASK) { - width = fls(mask) - ffs(mask) + 1; + u8 width = fls(mask) - ffs(mask) + 1; + if (width + shift > 16) { pr_err("mux value exceeds LOWORD field\n"); return ERR_PTR(-EINVAL); -- 2.35.1