Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp476560ybl; Fri, 31 Jan 2020 02:24:57 -0800 (PST) X-Google-Smtp-Source: APXvYqzjtvZA/xvhqK41nfO7Q+oKqtyHR8LAyAiOKiZurAOm3LAOz0JlQncvXy9XwP+gAfen5ZwR X-Received: by 2002:a05:6830:22ca:: with SMTP id q10mr7698384otc.280.1580466297166; Fri, 31 Jan 2020 02:24:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580466297; cv=none; d=google.com; s=arc-20160816; b=ufpIJSyC7WiqEfvJzOsVAOqNLZRnB0Vj9dnC6LDTIA9RLfAJUJYxiVg5YGAtEAif2E bNLIoB08Wz1Z7SX4Dm8DzxBUcXlLVzlpO+pHLKSmj2InsTzV+Lho8z1ncgDfChdBX90q HCoYEw8d1vWFZyMLVzbsJx8vI5IOV+LJgKiV08DV9KEpC0HRrRMFZYw3uLWonxkAXgXy XXYH4XE4Wmtyky6lftKg3PIty0BBeFg2UIUq3ya51X/TFoPKvuUegCyZrL5BU7OTaY7l 2rgcdl0WRsNksGjFB4JsE9sW9YXxNHKsLPH9/wJLpEWPJl+Mh6OkKB95tpSl/JNrfJUG PgUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:authenticated-by; bh=6aqL4jEd8XaousqVcZUHED6j6VK2cj3F7HpBs2bs624=; b=r3pkU6TPzD2Od8IYD143uXVgHalqXzLh/8iZG2eCsVrDfKwHfGh9zj1qKgAByqW4eR hawK0GfEnPocbUnFEXQDr7wfCAlb0IqUbXYXpPBIUh4vIv0mqWmeTr+n/gUQxDUPVMr7 JOpG7kkLztVpYi1c20uPL6QZmp3oIt3IeIOQPlXM2klCL5iuZTfAUAbMFXXDyXszZ2yT BaztbdbauBYjnYoadFyGf9S4pR+vVbUKcFu5TeoFiT3I+5JVRly09ziMYGDFiMbGNrL5 6lxXski5FNGs9mMQ7PsMa8C014aRfgRjNCYKfnHRUhE/gz2P/2MKrpK0W/MpUhciOcsz eXCg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x20si4608317otq.222.2020.01.31.02.24.45; Fri, 31 Jan 2020 02:24:57 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728347AbgAaKXx convert rfc822-to-8bit (ORCPT + 99 others); Fri, 31 Jan 2020 05:23:53 -0500 Received: from rtits2.realtek.com ([211.75.126.72]:35106 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728071AbgAaKXx (ORCPT ); Fri, 31 Jan 2020 05:23:53 -0500 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID 00VANfqG016275, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (RTEXMB06.realtek.com.tw[172.21.6.99]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id 00VANfqG016275 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Jan 2020 18:23:41 +0800 Received: from RTEXDAG02.realtek.com.tw (172.21.6.101) by RTEXMB06.realtek.com.tw (172.21.6.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Fri, 31 Jan 2020 18:23:41 +0800 Received: from RTEXMB04.realtek.com.tw (172.21.6.97) by RTEXDAG02.realtek.com.tw (172.21.6.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Fri, 31 Jan 2020 18:23:40 +0800 Received: from RTEXMB04.realtek.com.tw ([fe80::d9c5:a079:495e:b999]) by RTEXMB04.realtek.com.tw ([fe80::d9c5:a079:495e:b999%6]) with mapi id 15.01.1779.005; Fri, 31 Jan 2020 18:23:40 +0800 From: Tony Chuang To: Nathan Chancellor , Kalle Valo CC: "linux-wireless@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "clang-built-linux@googlegroups.com" Subject: RE: [PATCH] rtw88: Initialize ret in rtw_wow_check_fw_status Thread-Topic: [PATCH] rtw88: Initialize ret in rtw_wow_check_fw_status Thread-Index: AQHV1w0+cQfBiHwgKkKd8alOOCYKsqgEkmQA Date: Fri, 31 Jan 2020 10:23:40 +0000 Message-ID: References: <20200130013308.16395-1-natechancellor@gmail.com> In-Reply-To: <20200130013308.16395-1-natechancellor@gmail.com> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.21.68.175] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor > Subject: [PATCH] rtw88: Initialize ret in rtw_wow_check_fw_status > > Clang warns a few times (trimmed for brevity): > > ../drivers/net/wireless/realtek/rtw88/wow.c:295:7: warning: variable > 'ret' is used uninitialized whenever 'if' condition is false > [-Wsometimes-uninitialized] > > Initialize ret to true and change the other assignments to false because > it is a boolean value. > > Fixes: 44bc17f7f5b3 ("rtw88: support wowlan feature for 8822c") > Link: https://github.com/ClangBuiltLinux/linux/issues/850 > Signed-off-by: Nathan Chancellor > --- > drivers/net/wireless/realtek/rtw88/wow.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/wireless/realtek/rtw88/wow.c > b/drivers/net/wireless/realtek/rtw88/wow.c > index af5c27e1bb07..5db49802c72c 100644 > --- a/drivers/net/wireless/realtek/rtw88/wow.c > +++ b/drivers/net/wireless/realtek/rtw88/wow.c > @@ -283,18 +283,18 @@ static void rtw_wow_rx_dma_start(struct rtw_dev > *rtwdev) > > static bool rtw_wow_check_fw_status(struct rtw_dev *rtwdev, bool > wow_enable) > { > - bool ret; > + bool ret = true; > > /* wait 100ms for wow firmware to finish work */ > msleep(100); > > if (wow_enable) { > if (!rtw_read8(rtwdev, REG_WOWLAN_WAKE_REASON)) > - ret = 0; > + ret = false; > } else { > if (rtw_read32_mask(rtwdev, REG_FE1IMR, BIT_FS_RXDONE) == 0 > && > rtw_read32_mask(rtwdev, REG_RXPKT_NUM, > BIT_RW_RELEASE) == 0) > - ret = 0; > + ret = false; > } > > if (ret) > -- > 2.25.0 NACK. This patch could lead to incorrect behavior of WOW. I will send a new patch to fix it, and change the type to "int". Yan-Hsuan