From patchwork Wed Oct 9 00:42:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping-Ke Shih X-Patchwork-Id: 13827292 X-Patchwork-Delegate: pkshih@realtek.com Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (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 25751C8E0 for ; Wed, 9 Oct 2024 00:43:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728434600; cv=none; b=B9uiW2UWTv65P79WRnBt3sTeo8I6bPcTq5fkqKc3hKRXyo/O78Dk83aOi0YCIoY2miaUxLZ23jCBUvJFcqNoYK0fSz8Kdfm96tFO/FbJj/jbN0aBT9RbNhOP6F8RXZ61rMiXgIxKxoob/8GDTvLqJCGl/aC/coiBnHsEu89SGPc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728434600; c=relaxed/simple; bh=FY7w+vVAbCzgJu9YFIPfaETGWxcRscSrJmXcsYltC0A=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UOa4eiFlv03O8O3edvEuL4DSyxOTcmI14y+nmqhF5oGsNYHgN8nkIdAt4n5kw9varjk0McVWWXpl5UMxQ/Btp3oASVj7hx6FoaUqOmUxbFusunyhmRK7qsQMkCKgP0RaVcFm+yf2WB5axf9r1zeOr2+Ku+ld6t5nVCpwrOQw9Pk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=Jki9N6sr; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="Jki9N6sr" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4990hF8M14153164, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1728434595; bh=FY7w+vVAbCzgJu9YFIPfaETGWxcRscSrJmXcsYltC0A=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=Jki9N6srvGjT/722ycYn30vXQPYp1RWTY004MmVC6DzxxzdONH9QLsm3jYNJNE7S8 GRs/zaD/w7UuWghBltdRRhbBkwTExy6kWTv7e653RxzZNg9uqWyr7191lDB7sSZi+A hZJli76qatNvKPS7SYmMmGRZoxy/1Z1XkltG6I1DVqksTfH8Wz2c0n+5c640HBOzCS ksiCIqKBRgACoJ1Ety+NXioqyfwgkfGVYYa+pYWkc846sysepmJg2VAefZkv9xT/Dr fb/5JvJizAi7HKmM6PFRQL1DK5eM5/ngvBufGPSVuYCrcNNnbeSTkmFZHQO17FYLXY SC7RvcLEjRh6A== Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4990hF8M14153164 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 9 Oct 2024 08:43:15 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 9 Oct 2024 08:43:16 +0800 Received: from [127.0.1.1] (172.21.69.94) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 9 Oct 2024 08:43:15 +0800 From: Ping-Ke Shih To: Subject: [PATCH 1/6] wifi: rtw89: wow: cast nd_config->delay to u64 in tsf arithmetic Date: Wed, 9 Oct 2024 08:42:55 +0800 Message-ID: <20241009004300.8144-2-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241009004300.8144-1-pkshih@realtek.com> References: <20241009004300.8144-1-pkshih@realtek.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) The type of tsf arithmetic is u64 += u16 * int; When (u16 * int) is larger than 0x7FFFFFFF, the value casting to u64 with sign-extension will become all 1 in upper 32 bits part. To meet the case, u16 value should be larger than 20491 (0x7FFFFFFF / 104800). Fortunately the meaning of 20491 is delay time of WoWLAN net detection in unit of second, so 20491 seconds (5.7 hours) might not a real case we can meet. Addresses-Coverity-ID: 1620910 ("Unintended sign extension") Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c index 752a3c2536d4..252812781514 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -4963,7 +4963,7 @@ int rtw89_fw_h2c_scan_offload_ax(struct rtw89_dev *rtwdev, scan_mode = RTW89_SCAN_IMMEDIATE; } else { scan_mode = RTW89_SCAN_DELAY; - tsf += option->delay * RTW89_SCAN_DELAY_TSF_UNIT; + tsf += (u64)option->delay * RTW89_SCAN_DELAY_TSF_UNIT; } } From patchwork Wed Oct 9 00:42:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping-Ke Shih X-Patchwork-Id: 13827293 X-Patchwork-Delegate: pkshih@realtek.com Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (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 C6C9A17736 for ; Wed, 9 Oct 2024 00:43:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728434603; cv=none; b=FmRRwliUb1GYpjSlmGvAjCr5azflyfGjJJ0OGl2YcRwIwuEZulCJsypdmhy3tWkIJ6/8coIc/eAgjMJ3rEDgQMG5WJLDcX6P7H7yez4SD10zFO48uDQn5yYtO32jhRqwgmEg09SaECXja4SuuBrQdGBA0NUUXmlrp03Hxa8JsFc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728434603; c=relaxed/simple; bh=9MuJS3Zm1UE/dXuQZ06hU25X5eibJkVb7XGZGDMN9YE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Wb4/6feeULhW6MZXeF6yGn3o1GCkyBKS14rr4zM9Fpx7AnljCGfaoPgxZbkfkk8RkQkX6ivlnG7/5j5tv8y2VYiPxZtLjWYKuctP8hosYeCAcJx429IHjfhhkqnExZPHGRDFGcz3KFEoeVhVp8/O4AgGMctePjjfaqlPOhUPaYM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=XJGDfD0t; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="XJGDfD0t" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4990hJ0f94153173, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1728434599; bh=9MuJS3Zm1UE/dXuQZ06hU25X5eibJkVb7XGZGDMN9YE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=XJGDfD0tyjVMRP/2FN9LZfAX5tLvgCiYMNR5kGjWnyIeeGDF9daVS3j6Wbpa89BKp 4BUsth3usbjg6Y0JZ/RvA+8sfYxx/fKSD/WTGQM9AKmpZ115zEuVG4mUxrWL6sIJbz Ql6IFCu5lKcjwKTFr8D/LHzAnDgcuJAN8lgxn3MRmWgr4V4656ZZbUn+86u1yrZR2L 4PtsWjwEwtLYy2QjO+GxsgAOiPPfxUpWlF8ShnzPLd/RXpCEMU7Q78K0N2jkj9RwIS /GXyFEhlwyNfzmXSsslJJ6/M86Iys+z+/Tme+UXdEFk8rKaqEcqv2aIbZ1CN9ikWLw z4vi/kDWxWLGw== Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4990hJ0f94153173 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 9 Oct 2024 08:43:19 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 9 Oct 2024 08:43:19 +0800 Received: from [127.0.1.1] (172.21.69.94) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 9 Oct 2024 08:43:19 +0800 From: Ping-Ke Shih To: Subject: [PATCH 2/6] wifi: rtw89: pci: use 'int' as return type of error code in poll_{tx,rx}dma_ch_idle() Date: Wed, 9 Oct 2024 08:42:56 +0800 Message-ID: <20241009004300.8144-3-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241009004300.8144-1-pkshih@realtek.com> References: <20241009004300.8144-1-pkshih@realtek.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) The return type of error code of read_poll_timeout() and rtw89_pci_poll_{tx,rx}dma_ch_idle_ax() and must be 'int'. Correct them accordingly. Addresses-Coverity-ID: 1622341 ("Overflowed constant") Addresses-Coverity-ID: 1627296 ("Overflowed constant") Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c index 5ed7eaa18c85..b0753dd2e54c 100644 --- a/drivers/net/wireless/realtek/rtw89/pci.c +++ b/drivers/net/wireless/realtek/rtw89/pci.c @@ -2671,9 +2671,10 @@ static void rtw89_pci_clr_idx_all_ax(struct rtw89_dev *rtwdev) static int rtw89_pci_poll_txdma_ch_idle_ax(struct rtw89_dev *rtwdev) { const struct rtw89_pci_info *info = rtwdev->pci_info; - u32 ret, check, dma_busy; u32 dma_busy1 = info->dma_busy1.addr; u32 dma_busy2 = info->dma_busy2_reg; + u32 check, dma_busy; + int ret; check = info->dma_busy1.mask; @@ -2698,8 +2699,9 @@ static int rtw89_pci_poll_txdma_ch_idle_ax(struct rtw89_dev *rtwdev) static int rtw89_pci_poll_rxdma_ch_idle_ax(struct rtw89_dev *rtwdev) { const struct rtw89_pci_info *info = rtwdev->pci_info; - u32 ret, check, dma_busy; u32 dma_busy3 = info->dma_busy3_reg; + u32 check, dma_busy; + int ret; check = B_AX_RXQ_BUSY | B_AX_RPQ_BUSY; From patchwork Wed Oct 9 00:42:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping-Ke Shih X-Patchwork-Id: 13827294 X-Patchwork-Delegate: pkshih@realtek.com Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (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 3BFBAD530 for ; Wed, 9 Oct 2024 00:43:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728434606; cv=none; b=hwSoXB1IUp0+0SVKlTklr05YfgGrKXrhywJmH8QV8K4psu6d5y9cTOekTZzHt1NFUWh/k2nrQZxCmZZ2cZU8NOCKgMPB+j6iAkLa/JVJxvg8BOgTmcZD8bwNaSucv9sUoiSf9oypXfVnBMzpjJjbcdFlh8Wg3IDXB7QVri8Jntg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728434606; c=relaxed/simple; bh=e7InX5wrhtFywDNutUiVw9Nys9uU9fPOJO3V/Lk529w=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BLTYiFSJjC5PQObXGuPY+MNzurnYvCxXTzFW1KQpIz+9KomnBONxfmrBKNb+R5pDTYuREWIiZYnLolFNddN8mIEixZP5A5vz4BzLhAHHcFYpjRvzffAvI7Ab5ylIRiJpie+kS/vq6fKg+fGAQ6J4lZ7IxNMJpXgW5CKOm0PkHss= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=mOMKb1rf; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="mOMKb1rf" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4990hM9A14153176, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1728434603; bh=e7InX5wrhtFywDNutUiVw9Nys9uU9fPOJO3V/Lk529w=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=mOMKb1rfJuQnW5kkQ93mMZlND5RbHNPSFuuRize5OcoKRH39fz22XG50Ta1ydu+A/ IkNy7ifRCEY/D+FaZYouZXH/sNRiTE/QWJz6pn0VLkrEakc6ItUdGBb8CMsszA+cet t2ukgBSOo1D7PnBDZwmjw6CL7Ci6sXj6Jf1mF0hLg+yu4iaKiWRX+utYXFR91qaPOp cXzIZ4kzxz0qeNa/TbV+/z7IHtjWBIXr8aY3Q+WjRU+KmkWuiVM674pbkojH+U7W51 N6/7sducGk8okd0uzfSI6JHipzv8jGAHUgzffF7q2JnNs+tM9N6LJQEXgkTZ93/6L3 3L2QG3h7dTOhQ== Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4990hM9A14153176 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 9 Oct 2024 08:43:23 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 9 Oct 2024 08:43:23 +0800 Received: from [127.0.1.1] (172.21.69.94) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 9 Oct 2024 08:43:23 +0800 From: Ping-Ke Shih To: Subject: [PATCH 3/6] wifi: rtw89: 8851b: use 'int' as return type of error code pwr_{on,off}_func() Date: Wed, 9 Oct 2024 08:42:57 +0800 Message-ID: <20241009004300.8144-4-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241009004300.8144-1-pkshih@realtek.com> References: <20241009004300.8144-1-pkshih@realtek.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) The return type of error code of rtw8851b_pwr_{on,off}_func() and its callee is 'int'. Correct it. Addresses-Coverity-ID: 1624679 ("Overflowed constant") Addresses-Coverity-ID: 1630970 ("Overflowed constant") Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/rtw8851b.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/rtw8851b.c b/drivers/net/wireless/realtek/rtw89/rtw8851b.c index f9766bf30e71..1d70f7140827 100644 --- a/drivers/net/wireless/realtek/rtw89/rtw8851b.c +++ b/drivers/net/wireless/realtek/rtw89/rtw8851b.c @@ -282,7 +282,7 @@ static int rtw8851b_pwr_on_func(struct rtw89_dev *rtwdev) { u32 val32; u8 val8; - u32 ret; + int ret; rtw89_write32_clr(rtwdev, R_AX_SYS_PW_CTRL, B_AX_AFSM_WLSUS_EN | B_AX_AFSM_PCIE_SUS_EN); @@ -401,7 +401,7 @@ static void rtw8851b_patch_swr_pfm2pwm(struct rtw89_dev *rtwdev) static int rtw8851b_pwr_off_func(struct rtw89_dev *rtwdev) { u32 val32; - u32 ret; + int ret; ret = rtw89_mac_write_xtal_si(rtwdev, XTAL_SI_ANAPAR_WL, XTAL_SI_RFC2RF, XTAL_SI_RFC2RF); From patchwork Wed Oct 9 00:42:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping-Ke Shih X-Patchwork-Id: 13827295 X-Patchwork-Delegate: pkshih@realtek.com Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (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 A408BCA5B for ; Wed, 9 Oct 2024 00:43:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728434610; cv=none; b=cgMFrGI/AE5ySlbIQ9tKpioNtG3yEhRs5z0UojKYBo23jR3ciwwKIEQ3wg66ak81kqubDZtk3fi7f4+6sfVxtsJWer3ktSGa+NfPBseRokY2t/WJAjdDWCn99pAc2fui+E4N6pUV1PHRiTJ2Ecwj/AYKX4fwOrSDRsibkCGdSek= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728434610; c=relaxed/simple; bh=YzLnhPQ/UzwfBaI+lhgo8XVuAN/MbqCfVvmhz89Ohdw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PUX0upo/EQAImHdCUKj9/b+YvFHYWy6wJKElgrdaP9BatfN9yR37KwHYEU+3HXQyIYK2coRx7d/oMImIqfz5s7604mlTr41yW21c7kyIxe4l3hmOezRCfG0KVhchGXZLzZSFhnI1I02oENPptIMjDqj0nw6uIxoluUqaMcw1tYo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=OL0/VP7J; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="OL0/VP7J" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4990hQqhD4153368, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1728434606; bh=YzLnhPQ/UzwfBaI+lhgo8XVuAN/MbqCfVvmhz89Ohdw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=OL0/VP7JyVfpTjQdf20T6ISSMS4l+fiw5Rqb4r7UYZWXn+jur7o+VZOT9geZy7N83 p6ecLB3o8em5CJRGD7Rx4ehc7yXuZpgQNa41UbaNIScK69PXD7X3SUZjabT4Y0StDD mInJyNncnXWEX3nq+DWS9CsOmXMHDX6zbTrdyV8q39rcKV+7Sx0edEBD1xA0PCOie/ 3Ac6+Df9NPkrcIvXTpRb6RrKZAUdrPPsTogWJK5YJIOGYYSz1voX1tIxZ8cXsjyQGC VJ5QXpsEejWvwyo3yWZwJLPyM0F72y0jU6lorLfx+Nj/q2jx8WlJETOE52vp1snJbh lG+JjAbQK0dSQ== Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4990hQqhD4153368 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 9 Oct 2024 08:43:26 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 9 Oct 2024 08:43:26 +0800 Received: from [127.0.1.1] (172.21.69.94) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 9 Oct 2024 08:43:26 +0800 From: Ping-Ke Shih To: Subject: [PATCH 4/6] wifi: rtw89: 8852b: use 'int' as return type of error code pwr_{on,off}_func() Date: Wed, 9 Oct 2024 08:42:58 +0800 Message-ID: <20241009004300.8144-5-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241009004300.8144-1-pkshih@realtek.com> References: <20241009004300.8144-1-pkshih@realtek.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) The return type of error code of rtw8852b_pwr_{on,off}_func() and its callee is 'int'. Correct it. Addresses-Coverity-ID: 1622433 ("Overflowed constant") Addresses-Coverity-ID: 1630710 ("Overflowed constant") Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/rtw8852b.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852b.c b/drivers/net/wireless/realtek/rtw89/rtw8852b.c index 364aa21cbd44..ef1656991d0a 100644 --- a/drivers/net/wireless/realtek/rtw89/rtw8852b.c +++ b/drivers/net/wireless/realtek/rtw89/rtw8852b.c @@ -254,7 +254,7 @@ static void rtw8852b_pwr_sps_ana(struct rtw89_dev *rtwdev) static int rtw8852b_pwr_on_func(struct rtw89_dev *rtwdev) { u32 val32; - u32 ret; + int ret; rtw8852b_pwr_sps_ana(rtwdev); @@ -383,7 +383,7 @@ static int rtw8852b_pwr_on_func(struct rtw89_dev *rtwdev) static int rtw8852b_pwr_off_func(struct rtw89_dev *rtwdev) { u32 val32; - u32 ret; + int ret; rtw8852b_pwr_sps_ana(rtwdev); From patchwork Wed Oct 9 00:42:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping-Ke Shih X-Patchwork-Id: 13827296 X-Patchwork-Delegate: pkshih@realtek.com Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (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 78CAA15E8B for ; Wed, 9 Oct 2024 00:43:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728434612; cv=none; b=g5FZAnaGEeI2/TnRqcEL1RjulzelLhb0gXBlUlkd+CQZBufGLHThU6h7+jPR5M9ceKNIzmTGLUAsvO4lECs/eGw1Pt4BDA/zKFoFFaMMLBR42Mp/pQ7LFQNkbS8unrwjqKj1IFJPop6tL6HcLhsNRK1wfOh9HyqIMwFhfD+ZH7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728434612; c=relaxed/simple; bh=rNj2oyA42DBPhYoR0d7YnCBE3Nj1lCpmC1pjcsEpFWk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OsZLAPuYb91tLFXA96o+TvB2fc85OLGD6DczhQRWzgeu5WeX3q90A6623cHrCYlpXMadcUp7Ob5XLwvpSAz8KkaYZtPd3tJsoAzobVHjLyKRSZiCzzwA0Ae8/l/Q5mPTEAiGyyJdk81/9+aR2fjP/YsdRwNU/S5CD869E0dbfpI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=h2EX2+Xv; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="h2EX2+Xv" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4990hTLV14153816, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1728434609; bh=rNj2oyA42DBPhYoR0d7YnCBE3Nj1lCpmC1pjcsEpFWk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=h2EX2+XvnISbFg667BjOdlQyGgUeWz/Cp7UKZm5YhIhJQbFWUQO/lXUWVvUcmvFMR +sZ3Lr0pxKR8Su7D5dHuyt1p5WdWciyuDEqJB8M3XEQT4ohC6BUsCxvhKm7wLil5j/ 4AR2PDPFOXHSG/ZA6p19Yn9HBFjDcsTdPYWFU0GE/TsxcLsM3cnZGMwmQ+/xdTU/Yp X6I4y0N0ByfauqXs28yTmePaPyTKsBL7znkXpDt0vmQQ/hwAy9YZXERmGIv9Xu4OnB L7IzAYQxtz3xy6eeDOFmMMa47upUK+m9YlD8aormronSrHYbzQMpf6Spg0faJYXR4k 6v6gjHFEe8rhw== Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4990hTLV14153816 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 9 Oct 2024 08:43:29 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 9 Oct 2024 08:43:29 +0800 Received: from [127.0.1.1] (172.21.69.94) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 9 Oct 2024 08:43:29 +0800 From: Ping-Ke Shih To: Subject: [PATCH 5/6] wifi: rtw89: 8852bt: use 'int' as return type of error code pwr_{on,off}_func() Date: Wed, 9 Oct 2024 08:42:59 +0800 Message-ID: <20241009004300.8144-6-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241009004300.8144-1-pkshih@realtek.com> References: <20241009004300.8144-1-pkshih@realtek.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) The return type of error code of rtw8852bt_pwr_{on,off}_func() and its callee is 'int'. Correct it. Addresses-Coverity-ID: 1630962 ("Overflowed constant") Addresses-Coverity-ID: 1632126 ("Overflowed constant") Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/rtw8852bt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852bt.c b/drivers/net/wireless/realtek/rtw89/rtw8852bt.c index dab7e71ec6a1..38545bf65072 100644 --- a/drivers/net/wireless/realtek/rtw89/rtw8852bt.c +++ b/drivers/net/wireless/realtek/rtw89/rtw8852bt.c @@ -244,7 +244,7 @@ static const u8 rtw89_btc_8852bt_bt_rssi_thres[BTC_BT_RSSI_THMAX] = {50, 40, 30, static int rtw8852bt_pwr_on_func(struct rtw89_dev *rtwdev) { u32 val32; - u32 ret; + int ret; rtw89_write32_set(rtwdev, R_AX_LDO_AON_CTRL0, B_AX_PD_REGU_L); rtw89_write32_clr(rtwdev, R_AX_SYS_PW_CTRL, B_AX_AFSM_WLSUS_EN | @@ -357,7 +357,7 @@ static int rtw8852bt_pwr_on_func(struct rtw89_dev *rtwdev) static int rtw8852bt_pwr_off_func(struct rtw89_dev *rtwdev) { u32 val32; - u32 ret; + int ret; ret = rtw89_mac_write_xtal_si(rtwdev, XTAL_SI_ANAPAR_WL, XTAL_SI_RFC2RF, XTAL_SI_RFC2RF); From patchwork Wed Oct 9 00:43:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping-Ke Shih X-Patchwork-Id: 13827297 X-Patchwork-Delegate: pkshih@realtek.com Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (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 8CB5715E8B for ; Wed, 9 Oct 2024 00:43:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728434616; cv=none; b=oR8ztfTJRoh7PFovOfMY2kY3rTxZgAQNcWNUoZrkif4t51fpbZ4gmed6IRkD249T0XBqAWYIbOlb9hr9B0EGuRisOQXr+lS/ToUDcrx+FVjuCbF+OD1f+4VThMLK7Fbq1vST2lxLLErWXjd3hlJ1jFcS8E9NZS4yO0e2hcRfpXg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728434616; c=relaxed/simple; bh=SEZ1YJPBMZN04jxnu+BECB1F7H/I9to9yD4cPtWfrzM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XG5lENzNYWWBKAJ1UGYkMnL7PY9e94UXMKyz8k08BNZxgIM0YlOzViAb/W1VU2+yinCDGTeqlBisOV1p2vVxMwk5G5+mhQKUwa8ZJwRl4/1/DUV4hyt4qbYSBBgjhc9k0jiOo1jUOgkLuh/jUhVBcj1Qa4UVq8Jux8qMCMx1ytE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=rjD//ALD; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="rjD//ALD" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4990hW8w94153826, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1728434612; bh=SEZ1YJPBMZN04jxnu+BECB1F7H/I9to9yD4cPtWfrzM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=rjD//ALD04NQjWjIlo/GLvMD4gynUFAOioL0k5zpiKhS+KaP/keUGC8OHZbufqg/o pzEmhvpuwyigeYP3s7+0NA0BWL9rrYDl+eqBPhYhr+24//nrFZvsSUuyBrvjShiGh1 7AGmSzS40vifLwojeW8YplCNWDVvvBuPMy72IWPaIK3no88+4AdcDbPkjlvqmJDUMg f97rYNVLPAqSRYXnjrU/ond/Mrg92Agyijlt3DbJBAdVyxSt73QIixv3dFmVRCzGiE Se9SpGY++BhvE/zBUYMTJujdaV0JbgwZmhsJ96mOTbIL0u7CdzHjSJn54do4hwc33+ Oagm0Fsfkabow== Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4990hW8w94153826 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 9 Oct 2024 08:43:32 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 9 Oct 2024 08:43:33 +0800 Received: from [127.0.1.1] (172.21.69.94) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 9 Oct 2024 08:43:32 +0800 From: Ping-Ke Shih To: Subject: [PATCH 6/6] wifi: rtw89: 8852c: use 'int' as return type of error code pwr_{on,off}_func() Date: Wed, 9 Oct 2024 08:43:00 +0800 Message-ID: <20241009004300.8144-7-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241009004300.8144-1-pkshih@realtek.com> References: <20241009004300.8144-1-pkshih@realtek.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) The return type of error code of rtw8852c_pwr_{on,off}_func() and its callee is 'int'. Correct it. Addresses-Coverity-ID: 1626056 ("Overflowed constant") Addresses-Coverity-ID: 1627945 ("Overflowed constant") Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/rtw8852c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852c.c b/drivers/net/wireless/realtek/rtw89/rtw8852c.c index dbe77abb2c48..c58b3e8068f4 100644 --- a/drivers/net/wireless/realtek/rtw89/rtw8852c.c +++ b/drivers/net/wireless/realtek/rtw89/rtw8852c.c @@ -203,7 +203,7 @@ static void rtw8852c_ctrl_tx_path_tmac(struct rtw89_dev *rtwdev, u8 tx_path, static int rtw8852c_pwr_on_func(struct rtw89_dev *rtwdev) { u32 val32; - u32 ret; + int ret; val32 = rtw89_read32_mask(rtwdev, R_AX_SYS_STATUS1, B_AX_PAD_HCI_SEL_V2_MASK); if (val32 == MAC_AX_HCI_SEL_PCIE_USB) @@ -324,7 +324,7 @@ static int rtw8852c_pwr_on_func(struct rtw89_dev *rtwdev) static int rtw8852c_pwr_off_func(struct rtw89_dev *rtwdev) { u32 val32; - u32 ret; + int ret; ret = rtw89_mac_write_xtal_si(rtwdev, XTAL_SI_ANAPAR_WL, XTAL_SI_RFC2RF, XTAL_SI_RFC2RF);