From patchwork Tue Dec 19 06:57:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Su Hui X-Patchwork-Id: 18280 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1758315dyi; Mon, 18 Dec 2023 23:01:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbnRLyrDT5KzE2v/acJXqKO53oEh74azWjb0xY7D8Wr4xO7dKB9dYHa013oEGqETM+t6gI X-Received: by 2002:ac8:7dc9:0:b0:425:9b42:3381 with SMTP id c9-20020ac87dc9000000b004259b423381mr20457224qte.71.1702969293167; Mon, 18 Dec 2023 23:01:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702969293; cv=none; d=google.com; s=arc-20160816; b=U/tSyoQdZdaoelHzljnU0hY2U37o4UfIquJNS4NH5MUxHM+E1aZUISpgAp+aCnDyfp oEGAz75Llgo4L524caXK5Wao+u/6fEpc0ajRbnlSgGzkDr3qIqYNdOHyqauGgirSqEh3 ZbRLAlUtFHLI56TrEXUXqIiV9BGvq4p4Y4bHbFaCOYnfHhdxculfNmc0K15kkmd5cXt8 hNukEJkma8usI0f+0PBoMaHwqa4sxpJoVXsDanA4PF2Mb/KYNV/NGKhJInGxjEmj0GZi 3cwhRqZktg68TunTPCXiAJUDXI+h/V9AE6KmMWqlIG5vySg2xc1XWV9Q9J/IJQHuYQUY 5nkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=fOOY3TeFGr25Cebmq7Cj9iNx0mqFyBnxjB8oRt8wYfw=; fh=TrXeXCmmDvrfYX0UDWyFpi8qvwTCJNFd9LpW/tbFGEc=; b=dQf30J25Y0Q5ehaL4sx57AtHE2XKW9GWnaQE8UA9d+Eqd3P0vMeeLhHvoqaW5rhCzO WpjKxHmwm/r0YvAnhojXm7a/dpxhiIBoSm0ELqoj1V68RffYA6mLb1LOP9dB9dFRRqwt CAniQXeNiqrc8aax8TiqeeM9s+bcgqZDNekEB8kXOK7AwDY0G2ujFoyqAX9FiAfA+qS5 s6UmHGP0Uom4a3NR3IQtF0Hv7NZK/RbHutrhH/WUe+BpccAqwPYDlQ6VDh2/p6bJC6dd N2qW2/mZBil36x0ssQuSRoi4rgQlh8fFwjPq42XEvhixtb+UeXK1Sp6Kcj+iagcMLLS8 rLAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4772-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4772-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r16-20020ac85c90000000b00425484ae0easi25769683qta.258.2023.12.18.23.01.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 23:01:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4772-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4772-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4772-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EB5571C22EF6 for ; Tue, 19 Dec 2023 07:01:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4B5311700; Tue, 19 Dec 2023 06:58:15 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mail.nfschina.com (unknown [42.101.60.195]) by smtp.subspace.kernel.org (Postfix) with SMTP id 6463812B80; Tue, 19 Dec 2023 06:58:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nfschina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nfschina.com Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPSA id 3FA5260F0D2BB; Tue, 19 Dec 2023 14:57:51 +0800 (CST) X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui To: pkshih@realtek.com, kvalo@kernel.org Cc: Su Hui , Larry.Finger@lwfinger.net, linville@tuxdriver.com, george0505@realtek.com, chaoming_li@realsil.com.cn, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH wireless-next 00/11] using calculate_bit_shift() to fix undefined bitwise shift behavior. Date: Tue, 19 Dec 2023 14:57:28 +0800 Message-Id: <20231219065739.1895666-1-suhui@nfschina.com> X-Mailer: git-send-email 2.30.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785692729646783441 X-GMAIL-MSGID: 1785692729646783441 There is an undefined bitwise shift behavior, when the right operand is greater than or equal to then width of the promoted left operand. (eg: (u32)data << 32). Commit bc8263083af6("fix an undefined bitwise shift behavior") only fixed one problem, there are many similar problems in drivers/net/wireless/realtek/. This patchset adds a new function calculate_bit_shift() to fix the remaining undefined bitwise shift behavior problems.(Compile tested only) Su Hui (11): wifi: rtlwifi: add calculate_bit_shift() wifi: rtlwifi: rtl8821ae: phy: using calculate_bit_shift() wifi: rtlwifi: rtl8188ee: phy: using calculate_bit_shift() wifi: rtlwifi: rtl8192c: using calculate_bit_shift() wifi: rtlwifi: rtl8192cu: using calculate_bit_shift() wifi: rtlwifi: rtl8192ce: using calculate_bit_shift() wifi: rtlwifi: rtl8192de: using calculate_bit_shift() wifi: rtlwifi: rtl8192ee: using calculate_bit_shift() wifi: rtlwifi: rtl8192se: using calculate_bit_shift() wifi: rtlwifi: rtl8723_common: using calculate_bit_shift() wifi: rtlwifi: rtl8723{be,ae}: using calculate_bit_shift() .../net/wireless/realtek/rtlwifi/rtl8188ee/phy.c | 14 ++++---------- .../realtek/rtlwifi/rtl8192c/phy_common.c | 12 ++---------- .../realtek/rtlwifi/rtl8192c/phy_common.h | 1 - .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.c | 6 +++--- .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.h | 1 - .../net/wireless/realtek/rtlwifi/rtl8192cu/phy.c | 6 +++--- .../net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 15 ++++----------- .../net/wireless/realtek/rtlwifi/rtl8192ee/phy.c | 16 ++++------------ .../net/wireless/realtek/rtlwifi/rtl8192se/phy.c | 15 ++++----------- .../net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 6 +++--- .../net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 4 ++-- .../realtek/rtlwifi/rtl8723com/phy_common.c | 12 ++---------- .../realtek/rtlwifi/rtl8723com/phy_common.h | 1 - .../net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 15 ++++----------- drivers/net/wireless/realtek/rtlwifi/wifi.h | 7 +++++++ 15 files changed, 42 insertions(+), 89 deletions(-)