staging: rtl8192e: Remove if conditions.
PATCH 1/1 staging: rtl8192e: Remove if conditions.
This patch removes if conditions with no exececutable statements in the bodies of those ifs and also no variable assignments in the if conditional checks.
--- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 12 ------------ 1 file changed, 12 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +0 -12
@@ -572,10 +572,6 @@ static int r8192_wx_set_essid(struct net_device *dev,struct r8192_priv *priv =rtllib_priv (dev);int ret; -if ((rtllib_act_scanning (priv->rtllib, false)) && - !(priv->rtllib->softmac_features &IEEE_SOFTMAC_SCAN )) { - ;/* TODO - get rid of if */ - }if (priv->bHwRadioOff == true) {printk (KERN_INFO "=========>%s():hw radio off,or Rf state is " "eRfOff, return\n" , __func__);
@@ -708,11 +704,6 @@ static int r8192_wx_set_wap(struct net_device *dev,int ret;struct r8192_priv *priv =rtllib_priv (dev); -if ((rtllib_act_scanning (priv->rtllib, false)) && - !(priv->rtllib->softmac_features &IEEE_SOFTMAC_SCAN )) { - ;/* TODO - get rid of if */ - } -if (priv->bHwRadioOff == true)return 0 ;
@@ -763,9 +754,6 @@ static int r8192_wx_set_enc(struct net_device *dev, {0x00, 0x00, 0x00, 0x00, 0x00, 0x03} };int i; -if ((rtllib_act_scanning (priv->rtllib, false)) && - !(priv->rtllib->softmac_features &IEEE_SOFTMAC_SCAN )) - ;/* TODO - get rid of if */ if (priv->bHwRadioOff == true)return 0 ;
Signature · 1 line
1.9.1
Quoted 14 lines · Navya Sri Nizamkari
This patch removes if conditions with no exececutable statements in the bodies of those ifs and also no variable assignments in the if conditional checks.
Signed-off-by Navya Sri Nizamkari <[email protected]>--- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 12 ------------ 1 file changed, 12 deletions(-)drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +0
-0
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c static int r8192_wx_set_essid(struct net_device *dev, · line 578
Quoted 7 lines
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +0
-4@@ -572,10 +572,6 @@ static int r8192_wx_set_essid(struct net_device *dev,struct r8192_priv *priv =rtllib_priv (dev);int ret; -if ((rtllib_act_scanning (priv->rtllib, false)) && - !(priv->rtllib->softmac_features &IEEE_SOFTMAC_SCAN )) { - ;/* TODO - get rid of if */ - }
I'm not sure that this is correct. Can the call to rtllib_act_scanning have any side effects? If not, you should mention that explicitly in teh commit message.
julia
Quoted 35 lines
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +0
-9if (priv->bHwRadioOff == true) {printk (KERN_INFO "=========>%s():hw radio off,or Rf state is " "eRfOff, return\n" , __func__);@@ -708,11 +704,6 @@ static int r8192_wx_set_wap(struct net_device *dev,int ret;struct r8192_priv *priv =rtllib_priv (dev); -if ((rtllib_act_scanning (priv->rtllib, false)) && - !(priv->rtllib->softmac_features &IEEE_SOFTMAC_SCAN )) { - ;/* TODO - get rid of if */ - } -if (priv->bHwRadioOff == true)return 0 ;@@ -763,9 +754,6 @@ static int r8192_wx_set_enc(struct net_device *dev, {0x00, 0x00, 0x00, 0x00, 0x00, 0x03} };int i; -if ((rtllib_act_scanning (priv->rtllib, false)) && - !(priv->rtllib->softmac_features &IEEE_SOFTMAC_SCAN )) - ;/* TODO - get rid of if */ if (priv->bHwRadioOff == true)return 0 ; --1.9.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20150228215501.GA5201%40localhost.
For more options, visit https://groups.google.com/d/optout.
Quoted 29 lines · Julia Lawall
Review
Quoted 10 lines · Navya Sri Nizamkari
This patch removes if conditions with no exececutable statements in the bodies of those ifs and also no variable assignments in the if conditional checks.
Signed-off-by Navya Sri Nizamkari <[email protected] <javascript:>>---
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 12 ------------ 1 file changed, 12 deletions(-)(quoted diff) +0
-0
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.cdrivers/staging/rtl8192e/rtl8192e/rtl_wx.c static int r8192_wx_set_essid(struct net_device
Quoted 4 lines
index df0323f..c233a1c 100644
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +0
-0@@ -572,10 +572,6 @@ static int r8192_wx_set_essid(struct net_device*dev,
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c static int r8192_wx_set_essid(struct net_device *dev, · line 578
Quoted 7 lines
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +0
-4struct r8192_priv *priv =rtllib_priv (dev);int ret; -if ((rtllib_act_scanning (priv->rtllib, false)) && - !(priv->rtllib->softmac_features &IEEE_SOFTMAC_SCAN )) { - ;/* TODO - get rid of if */ - }
Quoted 6 lines
I'm not sure that this is correct. Can the call to
rtllib_act_scanninghave any side effects? If not, you should mention that explicitly in teh commit message.julia
Hi,
No, the call to rtllib_act_scanning has no side effects.
The function definition :
bool <http://lxr.free-electrons.com/ident?i=bool> rtllib_act_scanning <http://lxr.free-electrons.com/ident?i=rtllib_act_scanning>(struct rtllib_device <http://lxr.free-electrons.com/ident?i=rtllib_device> *ieee, bool <http://lxr.free-electrons.com/ident?i=bool> sync_scan)
{
if (ieee->softmac_features & IEEE_SOFTMAC_SCAN <http://lxr.free-electrons.com/ident?i=IEEE_SOFTMAC_SCAN>) {
if (sync_scan)
return ieee->be_scan_inprogress;
else
return ieee->actscanning || ieee->be_scan_inprogress;
} else {
return test_bit <http://lxr.free-electrons.com/ident?i=test_bit>(STATUS_SCANNING <http://lxr.free-electrons.com/ident?i=STATUS_SCANNING>, &ieee->status <http://lxr.free-electrons.com/ident?i=status>);
}}
It doesn't make any other changes.
Thanks,
Navya
Quoted 43 lines
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c static int r8192_wx_set_essid(struct net_device · line 576
Quoted 3 lines
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +0
-0if (priv->bHwRadioOff == true) { printk(KERN_INFO "=========>%s():hw radio off,or Rfstate is "
Quoted 28 lines
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +0
-8"eRfOff, return\n", __func__);@@ -708,11 +704,6 @@ static int r8192_wx_set_wap(struct net_device *dev,int ret;struct r8192_priv *priv =rtllib_priv (dev); -if ((rtllib_act_scanning (priv->rtllib, false)) && - !(priv->rtllib->softmac_features &IEEE_SOFTMAC_SCAN )) { - ;/* TODO - get rid of if */ - } -if (priv->bHwRadioOff == true)return 0 ;@@ -763,9 +754,6 @@ static int r8192_wx_set_enc(struct net_device *dev, {0x00, 0x00, 0x00, 0x00, 0x00, 0x03} };int i; -if ((rtllib_act_scanning (priv->rtllib, false)) && - !(priv->rtllib->softmac_features &IEEE_SOFTMAC_SCAN )) - ;/* TODO - get rid of if */ if (priv->bHwRadioOff == true)return 0 ;Signature · 4 lines
1.9.1 -- You received this message because you are subscribed to the GoogleGroups "outreachy-kernel" group.
Quoted 1 line
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected] <javascript:>.
Quoted 1 line
To post to this group, send email to [email protected]
<javascript:>.
Quoted 1 line
To view this discussion on the web visit
https://groups.google.com/d/msgid/outreachy-kernel/20150228215501.GA5201%40localhost.
Quoted 2 lines
For more options, visit https://groups.google.com/d/optout.
Quoted 15 lines
No, the call to
rtllib_act_scanninghas no side effects.The function definition :
bool
rtllib_act_scanning(struct rtllib_device *ieee, bool sync_scan){ if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) { if (sync_scan) return ieee->be_scan_inprogress; else return ieee->actscanning || ieee->be_scan_inprogres s; } else { return test_bit(STATUS_SCANNING, &ieee->status); }
Quoted 3 lines
}
It doesn't make any other changes.
OK, looks good.
julia
Quoted 62 lines
Thanks,
Navya> if (priv->bHwRadioOff == true) { > printk(KERN_INFO "=========>%s():hw radio off,or Rf state is " > "eRfOff, return\n", __func__); > @@ -708,11 +704,6 @@ static int r8192_wx_set_wap(struct net_device *dev, > int ret; > struct r8192_priv *priv = rtllib_priv(dev); > > - if ((rtllib_act_scanning(priv->rtllib, false)) && > - !(priv->rtllib->softmac_features & IEEE_SOFTMAC_SCAN)) { > - ; /* TODO - get rid of if */ > - } > - > if (priv->bHwRadioOff == true) > return 0; > > @@ -763,9 +754,6 @@ static int r8192_wx_set_enc(struct net_device *dev, > {0x00, 0x00, 0x00, 0x00, 0x00, 0x03} }; > int i; > > - if ((rtllib_act_scanning(priv->rtllib, false)) && > - !(priv->rtllib->softmac_features & IEEE_SOFTMAC_SCAN)) > - ; /* TODO - get rid of if */ > if (priv->bHwRadioOff == true) > return 0; > > -- > 1.9.1 > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/20150228215501.GA5201%40 localhost. > For more options, visit https://groups.google.com/d/optout. >--
You received this message because you are subscribed to the Google Groups
"outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/8f8344f2-dc88-4816-b7bc- 62536fc20f2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.