Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp326640rdh; Mon, 18 Dec 2023 23:12:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEwLBSxY5TxKuWbI+QwqvN684Y8FbHTWGZvU11eGQM5dMLQuVXRhQoVosjy/ULzu3lvEvSn X-Received: by 2002:a17:906:c114:b0:a19:a19b:55e0 with SMTP id do20-20020a170906c11400b00a19a19b55e0mr10391975ejc.112.1702969939503; Mon, 18 Dec 2023 23:12:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702969939; cv=none; d=google.com; s=arc-20160816; b=aPfxKCngy0ymKML9E2qKfrFMjUrRCPI56aJ6EdyijSxeBijUkCzcrjkZV6fGWI5AfF VwpvH0n9Uaac4Z9jMbw7o7MtWz2DUIi/Sbmc9nV13N4dcuXac8B9a5LvmDnr6M3pRGpQ rnmTzZNdX7wqaoxcguG0eFDwLv7spxOH2nCDfpErH8iDEK7zjKjKp8ZeGEc863iNhIRD oXXrXJ2yFvg+RMArSWsr1Vb68N8oz51cbjYsPYlCYgAPy62T5iuhZXO/AbuffbC+8kX6 HGY2lMXqw3h96XusX8omEDYgbySCEeXGwP/37hu26/nd7vjapJV3VrAjipSb7Q+K42KI CzGA== 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=T/q2PzbOuxXi5Va51FX9yOtXKfkbrqg4UvN277tx7eXM47XJt6Q46DLqmmDggYuMVI 4yiDR5XVSRKENa4KkiiQQ62eqOE7R+cK/0K3xc/vOO9sHngfxJMdjRY/K1TVfjZltIIZ vAfyDSMvaeIQggG7Dt6wCh7wpt/EAeadk7SrxlMaoaaJoFI+K9pb8odmLVLoy84taiCP opQNWbVZj31L3WbamWEYv81J5T1c/sJCRZxfc8+YLWjpwXDkW4nfOr4Z+n4Mx5WA+qVk drWPLNgGEZYxKRRG8SVYEjr6rpi77jl/7gWerP8L2kmHEyrs2pNRcZzZKNy0AEP6wBkY pUOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-960-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-960-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o7-20020a1709064f8700b00a2322e239e1si3029264eju.142.2023.12.18.23.12.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 23:12:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-960-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-960-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-960-linux.lists.archive=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 00BC71F24EA1 for ; Tue, 19 Dec 2023 07:01:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6540115AD6; Tue, 19 Dec 2023 06:58:14 +0000 (UTC) X-Original-To: linux-wireless@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-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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(-) -- 2.30.2