Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp44314rdh; Wed, 22 Nov 2023 17:35:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IHb750AbXpPMdzjCJ4ePKVaT5eYPTf/Ie8M/gyIK9tnOZxCK/4NOQJnME6vq/leI3m9mLrO X-Received: by 2002:a17:902:d4d2:b0:1ce:5853:1ff2 with SMTP id o18-20020a170902d4d200b001ce58531ff2mr4989734plg.11.1700703317263; Wed, 22 Nov 2023 17:35:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700703317; cv=none; d=google.com; s=arc-20160816; b=Nlf8NyV8o78qCwqGvoiyP+584ODH5113Yk7YHNpejmXmYhuOZCO+vfPzUwRD5+4B+S +L3GhNgQFV/s8rEAt045fBYpd0JwBn4oo/c1+xBEeFjyNEOp4IjXtGr9Ho79rw/kFqR3 5XMDFFqBPhJh0jd+XrUWvlRNxa/zt9899KjnI5tF/HaF57UUQqLPEnToj7azAIRHUQck 6AzIJEDKj6/AZf4eAAOQvifyxlmliWX9yq/m5xAlNlBmbPNh2eMXD8a3CwqK2H0p6YAi n81VRU/rdLSrTZSQxd7R8nv60fg9BAMQ1D78HQrU/fBBaUaBWA/Fq3n6lKXqII1VTkqD OmCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:cc:to:content-language :subject:user-agent:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:date:message-id; bh=sWjUKm9IRhgpjNVKYUjteBwodZ+VGjfYnT2vTKC0xzg=; fh=2CFcP8ZToaXWmjtbeudKCKg0PHPQDURaeGCfDmXopgw=; b=xfJ8ylkllKFypb0kPIXjwIOPJ9KZE8kM3fL7sXTnetR5SbYV5iVkL3LS48q+LKsRPd +hmBMHRLAnTIGhG0OZskRPBJkrAX997RrP5dpnfK4pUVqLP6j37oiCVoTMLYo48YhwIp rw8UShBENweanYGkGrxSNY8pFCNReUl9qyCdLmMp+MVRpq1sr0Tewf/M1FPL22XfQcKd +OGNzLzHCHb5qqzGNQxi1GobiZOICYELqfb7BmtWLCiZ6Qq2Qy3tb54XNZo/Lif128+9 23HekIqF92XKyXuugjVycP6A8q+HazkimwayikPqnIMI3UwZ0HIbCRoBWcFrPwpWBocO YV3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-3-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 20-20020a170902c25400b001ca7a4c8360si132846plg.31.2023.11.22.17.35.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 17:35:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-3-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E698DB20D1F for ; Thu, 23 Nov 2023 01:35:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D56961385; Thu, 23 Nov 2023 01:35:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=none X-Original-To: linux-wireless@vger.kernel.org Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id A4B0411F; Wed, 22 Nov 2023 17:35:02 -0800 (PST) Received: from [172.30.11.106] (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPSA id 93A156027E065; Thu, 23 Nov 2023 09:34:58 +0800 (CST) Message-ID: <79634dda-fd3b-5a93-9435-d0a1474b847f@nfschina.com> Date: Thu, 23 Nov 2023 09:34:57 +0800 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH wireless-next 2/2] rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior Content-Language: en-US To: Ping-Ke Shih , Dan Carpenter Cc: "kvalo@kernel.org" , "nathan@kernel.org" , "ndesaulniers@google.com" , "trix@redhat.com" , "lizetao1@huawei.com" , "linville@tuxdriver.com" , "Larry.Finger@lwfinger.net" , "linux-wireless@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "llvm@lists.linux.dev" , "kernel-janitors@vger.kernel.org" X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui In-Reply-To: <99ec66d717b249e781f9316cbd689521@realtek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2023/11/23 08:41, Ping-Ke Shih wrote: > >> -----Original Message----- >> From: Dan Carpenter >> Sent: Wednesday, November 22, 2023 9:02 PM >> To: Su Hui >> Cc: Ping-Ke Shih ; kvalo@kernel.org; nathan@kernel.org; ndesaulniers@google.com; >> trix@redhat.com; lizetao1@huawei.com; linville@tuxdriver.com; Larry.Finger@lwfinger.net; >> linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org; llvm@lists.linux.dev; >> kernel-janitors@vger.kernel.org >> Subject: Re: [PATCH wireless-next 2/2] rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior >> >> Perhaps, a better way to silence the warning is to just change >> _rtl8821ae_phy_calculate_bit_shift() to not return 32 bits? Do we >> really ever pass bitmask 0? No idea... >> > I think the bitmask should not 0, so just replace _rtl8821ae_phy_calculate_bit_shift() > by __ffs(bitmask). To be safer, callers can check bitmask is not 0 before calling. Thanks for your great suggestion! I will send v2 soon. Su Hui