From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from so254-9.mailgun.net (so254-9.mailgun.net [198.61.254.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C24893FC2 for ; Sun, 29 Aug 2021 07:28:52 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1630222135; h=Date: Message-Id: Cc: To: References: In-Reply-To: From: Subject: Content-Transfer-Encoding: MIME-Version: Content-Type: Sender; bh=op3VyKg7O4sdLRM2oeeBnJchO2NcFBh3uBIxrEvd7+c=; b=qFmQ/0B64xg36PFYDl30pkag7yNYGkStxAKS9hBQ6sdWmrDzvP0ZxE3dJKMitCso6IrvmgyV 15Pi22G3vh7s4yUY6poGHdwhRH1Z3ZRZghtenZajr69/OkFpGwsiMcXG7Ts7RNLPyyPvzWlw qCNFQzzWe95VgQFU5cmivCYNpFg= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyJmNGYzNyIsICJsbHZtQGxpc3RzLmxpbnV4LmRldiIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n01.prod.us-east-1.postgun.com with SMTP id 612b372ccd680e8969521ea1 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sun, 29 Aug 2021 07:28:44 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id BD57CC4338F; Sun, 29 Aug 2021 07:28:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,BAYES_00, MISSING_DATE,MISSING_MID,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from tykki.adurom.net (tynnyri.adurom.net [51.15.11.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id A20A4C4338F; Sun, 29 Aug 2021 07:28:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org A20A4C4338F Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] rtlwifi: rtl8192de: Fix initialization of place in _rtl92c_phy_get_rightchnlplace() From: Kalle Valo In-Reply-To: <20210823222014.764557-1-nathan@kernel.org> References: <20210823222014.764557-1-nathan@kernel.org> To: Nathan Chancellor Cc: Ping-Ke Shih , Colin Ian King , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, llvm@lists.linux.dev, Nathan Chancellor User-Agent: pwcli/0.1.0-git (https://github.com/kvalo/pwcli/) Python/3.7.3 Message-Id: <20210829072842.BD57CC4338F@smtp.codeaurora.org> Date: Sun, 29 Aug 2021 07:28:42 +0000 (UTC) Nathan Chancellor wrote: > Clang warns: > > drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:901:6: warning: > variable 'place' is used uninitialized whenever 'if' condition is false > [-Wsometimes-uninitialized] > if (chnl > 14) { > ^~~~~~~~~ > drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:909:9: note: > uninitialized use occurs here > return place; > ^~~~~ > drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:901:2: note: remove > the 'if' if its condition is always true > if (chnl > 14) { > ^~~~~~~~~~~~~~~ > drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:899:10: note: > initialize the variable 'place' to silence this warning > u8 place; > ^ > = '\0' > 1 warning generated. > > Commit 369956ae5720 ("rtlwifi: rtl8192de: Remove redundant variable > initializations") removed the initialization of place but it appears > that this removal was in the wrong function. > > _rtl92c_phy_get_rightchnlplace() returns place's value at the end of the > function so now if the if statement is false, place never gets > initialized. Add that initialization back to address the warning. > > place's initialization is not necessary in > rtl92d_get_rightchnlplace_for_iqk() as place is only used within the if > statement so it can be removed, which is likely what was intended in the > first place. > > Fixes: 369956ae5720 ("rtlwifi: rtl8192de: Remove redundant variable initializations") > Signed-off-by: Nathan Chancellor > Acked-by: Ping-Ke Shih > Reviewed-by: Kees Cook Patch applied to wireless-drivers-next.git, thanks. 533ccdae76fa rtlwifi: rtl8192de: Fix initialization of place in _rtl92c_phy_get_rightchnlplace() -- https://patchwork.kernel.org/project/linux-wireless/patch/20210823222014.764557-1-nathan@kernel.org/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches