Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp127863pxt; Wed, 4 Aug 2021 17:54:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbd0Zgz/bd9tGLUlQ4SEsZouhs+Vu9HkI1eInOnqvd/CaePNMNspgvPv4GKrKuF3JxF1OE X-Received: by 2002:a92:b712:: with SMTP id k18mr2907ili.187.1628124895648; Wed, 04 Aug 2021 17:54:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628124895; cv=none; d=google.com; s=arc-20160816; b=wKydHGdf6zfP9L42GbyIBY8p4yhXtUbhkr/Lns/D6jGCXwn8dltI0JRwi5+o53nauK 3vuqH2Yl3SMAVYJMSoMrBRV8gZopxq6XHJ2U/zKIzrqjjjRnT0cGjck/shUXjm1AwMqp j1ajRnueWEh70ObfxINFDHIx13Iee0LjsrUMPlfurE4pneMzZPtYgzZv4nMoVgYpqvxE AALBteDGaLy816T7ypHxANYLQieb9zJ48np2cf0krF6b71RfHz6y3eqk7AFw38Rn4sM9 gxusa2hcttWyre25V93JG7x2hJ7jL31jhHV0OEJa95z7tySF50HWvcoX352W47CGERDM 3AdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=bHpgtik3x5SZkX+YhF0mGZ7vkOXBc0CZIMlDTkx4CIQ=; b=Us86Jvq4+h1wHoEm1seELNDSn22HPhOTojQ9S0DxNhRNomHJRNVUQyZy4uOdawNW6U 3ffcK9+6/81FqwhIyMpIG4hui48B60zQgNm5jpNvm4WZOeGC2YQt3Wx/VGVIFrTwcR11 rsEHU5LIX2TFi3DZAx62KGkUm+xdoqAY9E2Eg3v3RNBnPLffnB1CVs8BoTmfiUu362CU 4E5gSWhSNGpwABHeYvaWfiHyg9+Fnr9Bq1LttzHlB9h+UJbAyG1vmBTLnDf57PlzMk7D IskXbkLdGsnQSNtblbGUKsuOXNftDaiu1EbmQGPUoy3CQVjVZ05sgGMapsv7m+QX7Rt7 mijQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=COHB57FE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j11si4653497ils.22.2021.08.04.17.54.43; Wed, 04 Aug 2021 17:54:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=COHB57FE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239030AbhHDSt6 (ORCPT + 99 others); Wed, 4 Aug 2021 14:49:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:59076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbhHDSt5 (ORCPT ); Wed, 4 Aug 2021 14:49:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5781E60F58; Wed, 4 Aug 2021 18:49:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628102984; bh=WUYVf156RcIPEwIWQn3ldzC8WUV1abI36QAKl5eC/p8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=COHB57FEbdoqnaj6DRj+DxURedg2b03AqX1WkNYAadldHNbF8Wbhh0v5NPTIrK5Le h/45eOZiub+mWChzs26HkFQHoEeOPJkm6dw0bPiWw6GFwZ0VkLJTqfbrAszIJash1U 5aL+rN5/wxUoI0Ght7rtyDGAvnHNpywJVFdpxpej7PPbCjJaXHACOhWi9xmOxfYyYu q7ZJr7TV06mKs9bXx9RDzKMkpfOO/vEmQfT1mlxOZ7JsmzWbf0ZDwCiXP0BC58KsYz xErSjhwSYZAvI7b5wR+Z862x6wPXicZfoNO4ZT9C4aN3e93rCvMSAGDlZ0cpAlYq6H rypDbYv46VHAQ== Subject: Re: [PATCH 3/4] staging: r8188eu: Remove self assignment in get_rx_power_val_by_reg() To: Nick Desaulniers Cc: Greg Kroah-Hartman , Phillip Potter , Larry Finger , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com References: <20210803223609.1627280-1-nathan@kernel.org> <20210803223609.1627280-4-nathan@kernel.org> From: Nathan Chancellor Message-ID: <431e7405-8761-b014-5c30-c68353ef5af9@kernel.org> Date: Wed, 4 Aug 2021 11:49:43 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/4/2021 11:37 AM, 'Nick Desaulniers' via Clang Built Linux wrote: > On Tue, Aug 3, 2021 at 3:36 PM Nathan Chancellor wrote: >> >> Clang warns: >> >> drivers/staging/r8188eu/hal/rtl8188e_rf6052.c:344:13: warning: >> explicitly assigning value of variable of type 'u32' (aka 'unsigned >> int') to itself [-Wself-assign] >> writeVal = writeVal; >> ~~~~~~~~ ^ ~~~~~~~~ >> 1 warning generated. >> >> Remove this branch as it is useless. >> >> Signed-off-by: Nathan Chancellor >> --- >> drivers/staging/r8188eu/hal/rtl8188e_rf6052.c | 2 -- >> 1 file changed, 2 deletions(-) >> >> diff --git a/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c b/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c >> index 335b120ce603..77889dc05858 100644 >> --- a/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c >> +++ b/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c >> @@ -340,8 +340,6 @@ static void get_rx_power_val_by_reg(struct adapter *Adapter, u8 Channel, >> /* This mechanism is only applied when Driver-Highpower-Mechanism is OFF. */ >> if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_BT1) >> writeVal = writeVal - 0x06060606; >> - else if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_BT2) >> - writeVal = writeVal; > > Hopefully the author didn't mean to subtract another magic constant > like they did above. This also eliminates the last use of > TxHighPwrLevel_BT2, but it's probably ok to keep the define in > drivers/staging/r8188eu/include/odm.h. For what it's worth, it seems that the DynamicTxHighPowerLvl member is only ever assigned TxHighPwrLevel_Normal so the first if statement is probably dead code too but I wanted to clean up the clang warnings, not rewrite the driver, since I could do that for hours upon hours :) > Reviewed-by: Nick Desaulniers Thanks for the review! Cheers, Nathan >> *(pOutWriteVal+rf) = writeVal; >> } >> } >> -- >> 2.33.0.rc0 > >