Fixes gcc '-Wunused-but-set-variable' warning:
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c: In function rtl8xxxu_c2hcmd_callback:
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:5396:24: warning: variable vif set but not used [-Wunused-but-set-variable]
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c: In function rtl8xxxu_c2hcmd_callback:
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:5397:17: warning: variable dev set but not used [-Wunused-but-set-variable]
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c: In function rtl8xxxu_c2hcmd_callback:
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:5400:6: warning: variable len set but not used [-Wunused-but-set-variable]
They are introduced by commit e542e66b7c2e ("rtl8xxxu:
add bluetooth co-existence support for single antenna"), but never used,
so remove them.
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: zhengbin <[email protected]>
---
v1->v2: modify comment, it --> they
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index 1d94cab..aa2bb2a 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -5393,18 +5393,13 @@ static void rtl8xxxu_c2hcmd_callback(struct work_struct *work)
{
struct rtl8xxxu_priv *priv;
struct rtl8723bu_c2h *c2h;
- struct ieee80211_vif *vif;
- struct device *dev;
struct sk_buff *skb = NULL;
unsigned long flags;
- int len;
u8 bt_info = 0;
struct rtl8xxxu_btcoex *btcoex;
priv = container_of(work, struct rtl8xxxu_priv, c2hcmd_work);
- vif = priv->vif;
btcoex = &priv->bt_coex;
- dev = &priv->udev->dev;
if (priv->rf_paths > 1)
goto out;
@@ -5415,7 +5410,6 @@ static void rtl8xxxu_c2hcmd_callback(struct work_struct *work)
spin_unlock_irqrestore(&priv->c2hcmd_lock, flags);
c2h = (struct rtl8723bu_c2h *)skb->data;
- len = skb->len - 2;
switch (c2h->id) {
case C2H_8723B_BT_INFO:
--
2.7.4
On Tue, Nov 19, 2019 at 10:18 AM zhengbin <[email protected]> wrote:
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c: In function rtl8xxxu_c2hcmd_callback:
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:5396:24: warning: variable vif set but not used [-Wunused-but-set-variable]
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c: In function rtl8xxxu_c2hcmd_callback:
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:5397:17: warning: variable dev set but not used [-Wunused-but-set-variable]
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c: In function rtl8xxxu_c2hcmd_callback:
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:5400:6: warning: variable len set but not used [-Wunused-but-set-variable]
>
> They are introduced by commit e542e66b7c2e ("rtl8xxxu:
> add bluetooth co-existence support for single antenna"), but never used,
> so remove them.
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: zhengbin <[email protected]>
> ---
> v1->v2: modify comment, it --> they
Reviewed-by: Chris Chiu <[email protected]>
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> index 1d94cab..aa2bb2a 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> @@ -5393,18 +5393,13 @@ static void rtl8xxxu_c2hcmd_callback(struct work_struct *work)
> {
> struct rtl8xxxu_priv *priv;
> struct rtl8723bu_c2h *c2h;
> - struct ieee80211_vif *vif;
> - struct device *dev;
> struct sk_buff *skb = NULL;
> unsigned long flags;
> - int len;
> u8 bt_info = 0;
> struct rtl8xxxu_btcoex *btcoex;
>
> priv = container_of(work, struct rtl8xxxu_priv, c2hcmd_work);
> - vif = priv->vif;
> btcoex = &priv->bt_coex;
> - dev = &priv->udev->dev;
>
> if (priv->rf_paths > 1)
> goto out;
> @@ -5415,7 +5410,6 @@ static void rtl8xxxu_c2hcmd_callback(struct work_struct *work)
> spin_unlock_irqrestore(&priv->c2hcmd_lock, flags);
>
> c2h = (struct rtl8723bu_c2h *)skb->data;
> - len = skb->len - 2;
>
> switch (c2h->id) {
> case C2H_8723B_BT_INFO:
> --
> 2.7.4
>
Those variables are handled by the derived helper functions
rtl8723bu_handle_bt_xxx and no longer needed in
rtl8xxxu_c2hcmd_callback(). Thanks for reporting.
Chris
zhengbin <[email protected]> wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c: In function rtl8xxxu_c2hcmd_callback:
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:5396:24: warning: variable vif set but not used [-Wunused-but-set-variable]
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c: In function rtl8xxxu_c2hcmd_callback:
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:5397:17: warning: variable dev set but not used [-Wunused-but-set-variable]
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c: In function rtl8xxxu_c2hcmd_callback:
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:5400:6: warning: variable len set but not used [-Wunused-but-set-variable]
>
> They are introduced by commit e542e66b7c2e ("rtl8xxxu:
> add bluetooth co-existence support for single antenna"), but never used,
> so remove them.
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: zhengbin <[email protected]>
> Reviewed-by: Chris Chiu <[email protected]>
Patch applied to wireless-drivers-next.git, thanks.
eac08515d7bd rtl8xxxu: Remove set but not used variable 'vif','dev','len'
--
https://patchwork.kernel.org/patch/11250639/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches