LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] rtw88: Remove set but not used variable 'ip_sel' and 'orig'
@ 2019-05-29 14:57 YueHaibing
  2019-05-30  2:32 ` Tony Chuang
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2019-05-29 14:57 UTC (permalink / raw)
  To: yhchuang, kvalo, davem; +Cc: linux-kernel, netdev, linux-wireless, YueHaibing

Fixes gcc '-Wunused-but-set-variable' warnings:

drivers/net/wireless/realtek/rtw88/pci.c: In function rtw_pci_phy_cfg:
drivers/net/wireless/realtek/rtw88/pci.c:978:6: warning: variable ip_sel set but not used [-Wunused-but-set-variable]
drivers/net/wireless/realtek/rtw88/phy.c: In function phy_tx_power_limit_config:
drivers/net/wireless/realtek/rtw88/phy.c:1607:11: warning: variable orig set but not used [-Wunused-but-set-variable]

They are never used, so can be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/wireless/realtek/rtw88/pci.c | 3 ---
 drivers/net/wireless/realtek/rtw88/phy.c | 3 +--
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c
index 353871c27779..8329f4e447b7 100644
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -977,7 +977,6 @@ static void rtw_pci_phy_cfg(struct rtw_dev *rtwdev)
 	u16 cut;
 	u16 value;
 	u16 offset;
-	u16 ip_sel;
 	int i;
 
 	cut = BIT(0) << rtwdev->hal.cut_version;
@@ -990,7 +989,6 @@ static void rtw_pci_phy_cfg(struct rtw_dev *rtwdev)
 			break;
 		offset = para->offset;
 		value = para->value;
-		ip_sel = para->ip_sel;
 		if (para->ip_sel == RTW_IP_SEL_PHY)
 			rtw_mdio_write(rtwdev, offset, value, true);
 		else
@@ -1005,7 +1003,6 @@ static void rtw_pci_phy_cfg(struct rtw_dev *rtwdev)
 			break;
 		offset = para->offset;
 		value = para->value;
-		ip_sel = para->ip_sel;
 		if (para->ip_sel == RTW_IP_SEL_PHY)
 			rtw_mdio_write(rtwdev, offset, value, false);
 		else
diff --git a/drivers/net/wireless/realtek/rtw88/phy.c b/drivers/net/wireless/realtek/rtw88/phy.c
index 404d89432c96..c3e75ffe27b5 100644
--- a/drivers/net/wireless/realtek/rtw88/phy.c
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
@@ -1604,12 +1604,11 @@ void rtw_phy_tx_power_by_rate_config(struct rtw_hal *hal)
 static void
 phy_tx_power_limit_config(struct rtw_hal *hal, u8 regd, u8 bw, u8 rs)
 {
-	s8 base, orig;
+	s8 base;
 	u8 ch;
 
 	for (ch = 0; ch < RTW_MAX_CHANNEL_NUM_2G; ch++) {
 		base = hal->tx_pwr_by_rate_base_2g[0][rs];
-		orig = hal->tx_pwr_limit_2g[regd][bw][rs][ch];
 		hal->tx_pwr_limit_2g[regd][bw][rs][ch] -= base;
 	}
 
-- 
2.17.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH] rtw88: Remove set but not used variable 'ip_sel' and 'orig'
  2019-05-29 14:57 [PATCH] rtw88: Remove set but not used variable 'ip_sel' and 'orig' YueHaibing
@ 2019-05-30  2:32 ` Tony Chuang
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Chuang @ 2019-05-30  2:32 UTC (permalink / raw)
  To: YueHaibing, kvalo, davem; +Cc: linux-kernel, netdev, linux-wireless



> -----Original Message-----
> From: YueHaibing [mailto:yuehaibing@huawei.com]
> Sent: Wednesday, May 29, 2019 10:58 PM
> To: Tony Chuang; kvalo@codeaurora.org; davem@davemloft.net
> Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org;
> linux-wireless@vger.kernel.org; YueHaibing
> Subject: [PATCH] rtw88: Remove set but not used variable 'ip_sel' and 'orig'
> 
> Fixes gcc '-Wunused-but-set-variable' warnings:
> 
> drivers/net/wireless/realtek/rtw88/pci.c: In function rtw_pci_phy_cfg:
> drivers/net/wireless/realtek/rtw88/pci.c:978:6: warning: variable ip_sel set
> but not used [-Wunused-but-set-variable]
> drivers/net/wireless/realtek/rtw88/phy.c: In function
> phy_tx_power_limit_config:
> drivers/net/wireless/realtek/rtw88/phy.c:1607:11: warning: variable orig set
> but not used [-Wunused-but-set-variable]
> 
> They are never used, so can be removed.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/net/wireless/realtek/rtw88/pci.c | 3 ---
>  drivers/net/wireless/realtek/rtw88/phy.c | 3 +--
>  2 files changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/pci.c
> b/drivers/net/wireless/realtek/rtw88/pci.c
> index 353871c27779..8329f4e447b7 100644
> --- a/drivers/net/wireless/realtek/rtw88/pci.c
> +++ b/drivers/net/wireless/realtek/rtw88/pci.c
> @@ -977,7 +977,6 @@ static void rtw_pci_phy_cfg(struct rtw_dev *rtwdev)
>  	u16 cut;
>  	u16 value;
>  	u16 offset;
> -	u16 ip_sel;
>  	int i;
> 
>  	cut = BIT(0) << rtwdev->hal.cut_version;
> @@ -990,7 +989,6 @@ static void rtw_pci_phy_cfg(struct rtw_dev *rtwdev)
>  			break;
>  		offset = para->offset;
>  		value = para->value;
> -		ip_sel = para->ip_sel;
>  		if (para->ip_sel == RTW_IP_SEL_PHY)
>  			rtw_mdio_write(rtwdev, offset, value, true);
>  		else
> @@ -1005,7 +1003,6 @@ static void rtw_pci_phy_cfg(struct rtw_dev
> *rtwdev)
>  			break;
>  		offset = para->offset;
>  		value = para->value;
> -		ip_sel = para->ip_sel;
>  		if (para->ip_sel == RTW_IP_SEL_PHY)
>  			rtw_mdio_write(rtwdev, offset, value, false);
>  		else
> diff --git a/drivers/net/wireless/realtek/rtw88/phy.c
> b/drivers/net/wireless/realtek/rtw88/phy.c
> index 404d89432c96..c3e75ffe27b5 100644
> --- a/drivers/net/wireless/realtek/rtw88/phy.c
> +++ b/drivers/net/wireless/realtek/rtw88/phy.c
> @@ -1604,12 +1604,11 @@ void rtw_phy_tx_power_by_rate_config(struct
> rtw_hal *hal)
>  static void
>  phy_tx_power_limit_config(struct rtw_hal *hal, u8 regd, u8 bw, u8 rs)
>  {
> -	s8 base, orig;
> +	s8 base;
>  	u8 ch;
> 
>  	for (ch = 0; ch < RTW_MAX_CHANNEL_NUM_2G; ch++) {
>  		base = hal->tx_pwr_by_rate_base_2g[0][rs];
> -		orig = hal->tx_pwr_limit_2g[regd][bw][rs][ch];
>  		hal->tx_pwr_limit_2g[regd][bw][rs][ch] -= base;
>  	}
> 


Hi Haibing

I have submitted a patch fix the unused variable in phy.c
Which is,

> drivers/net/wireless/realtek/rtw88/phy.c: In function
> phy_tx_power_limit_config:
> drivers/net/wireless/realtek/rtw88/phy.c:1607:11: warning: variable orig set
> but not used [-Wunused-but-set-variable]

Can you drop the changes in phy.c and remain the changes in pci.c?
Thanks.

Yan-Hsuan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-30  2:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-29 14:57 [PATCH] rtw88: Remove set but not used variable 'ip_sel' and 'orig' YueHaibing
2019-05-30  2:32 ` Tony Chuang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).