Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2696250pxb; Sun, 29 Aug 2021 00:31:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzreyx5VaPd1ZJHHM3mpazCnO/cKtYMlvcaQW85NML2VUVlU1K/h/1aCT7KrhwfpIURp0HE X-Received: by 2002:a05:6e02:964:: with SMTP id q4mr12395809ilt.229.1630222269352; Sun, 29 Aug 2021 00:31:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630222269; cv=none; d=google.com; s=arc-20160816; b=iGBVqK7iM5IX9FSrjP5cvijHsOVTc7b7NQnHRbhIrVzFo3xWIO9L0Dq9GMRAeKW/hI s84Tt9jXSMSNcsxVXz9F2P6QBrdQ6a2s8MVApOXPWh/lMJxbtEjh7+GTbAKIunzDuK7o Ep69xcIGBtvEOJuNKEuPjLpLvynvyh7kEbI/3joxH+ZjL2QRIgcX255FJgdGAFdyCGfz dG2yFpmK6M36LI26qm9UNQe4qe9edhFXBXhpwr4OwkYNtILIY7zWNEPgFntOlRzup/3S KE4yzv99INKHm3fUz2IqVmtuSgjfPrgH+WKa4sA7vr2VOZNYZd1rF5ftqLnnDbdiSsHq mBxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:user-agent:cc:to:references :in-reply-to:from:subject:content-transfer-encoding:mime-version :dmarc-filter:sender:dkim-signature; bh=op3VyKg7O4sdLRM2oeeBnJchO2NcFBh3uBIxrEvd7+c=; b=l/xwhnd6nMusMwYgyD8cIDjqXd1iHRGGiNb4GiwKMB9+WM/zlE7dS3bs4+/1U1UtpO B7E39YDdb7j+wZAdfhTS+uiJVOQT7xql9EilPeMomsYXvm8FUUIcnJMY3tgttXgWCNjc gUSt3xPWanRtNAHPDMeWV8JVGouNaBwgJSwbi1rJlzUATHvCjy9F46JlV+ri/NTvny3P fBe7avD2dbniw/y74G12a0S5tnMhGQf53wTz23MzfS5wECcg4XBtzTKX2VwjKGZILogp rpQSJ66cwwU3bw5xjAw6rSlUKF1BGjGC0W2aePFSHFUzBEM/o2z4b78Gq59PIlZWlV5J HfzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=TjaUafQV; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i7si11000846ils.74.2021.08.29.00.30.48; Sun, 29 Aug 2021 00:31:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=TjaUafQV; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234757AbhH2H3g (ORCPT + 99 others); Sun, 29 Aug 2021 03:29:36 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:10607 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233025AbhH2H3f (ORCPT ); Sun, 29 Aug 2021 03:29:35 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1630222124; h=Date: Message-Id: Cc: To: References: In-Reply-To: From: Subject: Content-Transfer-Encoding: MIME-Version: Content-Type: Sender; bh=op3VyKg7O4sdLRM2oeeBnJchO2NcFBh3uBIxrEvd7+c=; b=TjaUafQV4GkohmkCHbeZhcyx+4R6UNJe3th02p3uH3+WX8JszkayRk8G6/Qc4FNFWPGU7Ppp +wedvTOqy4S5o7vi2MmKxgyFNIsWvo3E2DXJGshB6fcr4AXOZ0OWBxi2yI86eKZAG0fhXvGv nLx5z5ezjNPXPqBdbEUVh+nVv6o= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 612b372bd6653df76731c748 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sun, 29 Aug 2021 07:28:43 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id C771CC43618; 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" 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.C771CC43618@smtp.codeaurora.org> Date: Sun, 29 Aug 2021 07:28:42 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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