* [PATCH] Staging: rtl8192e: Eliminate use of macro IS_NIC_DOWN [not found] <cover.1425367678.git.vthakkar1994@gmail.com> @ 2015-03-03 7:38 ` Vaishali Thakkar 2015-03-03 7:39 ` [PATCH] Staging: rtl8192u: Fix duplicate conditional branch Vaishali Thakkar 1 sibling, 0 replies; 6+ messages in thread From: Vaishali Thakkar @ 2015-03-03 7:38 UTC (permalink / raw) To: outreachy-kernel This patch eliminates use of unnecessory macro IS_NIC_DOWN and replaces it with standard code. Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> --- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 10 +++++----- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 10 +++++----- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 -- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 4 ++-- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c index 8c08ef6..cd3c662 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c @@ -996,7 +996,7 @@ static void rtl8192_phy_FinishSwChnlNow(struct net_device *dev, u8 channel) &priv->SwChnlStep, &delay)) { if (delay > 0) msleep(delay); - if (IS_NIC_DOWN(priv)) + if (!priv->up) break; } } @@ -1020,7 +1020,7 @@ u8 rtl8192_phy_SwChnl(struct net_device *dev, u8 channel) struct r8192_priv *priv = rtllib_priv(dev); RT_TRACE(COMP_PHY, "=====>%s()\n", __func__); - if (IS_NIC_DOWN(priv)) { + if (!priv->up) { RT_TRACE(COMP_ERR, "%s(): ERR !! driver is not up\n", __func__); return false; } @@ -1060,7 +1060,7 @@ u8 rtl8192_phy_SwChnl(struct net_device *dev, u8 channel) priv->SwChnlStage = 0; priv->SwChnlStep = 0; - if (!IS_NIC_DOWN(priv)) + if (priv->up) rtl8192_SwChnl_WorkItem(dev); priv->SwChnlInProgress = false; return true; @@ -1186,7 +1186,7 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev) priv->SetBWModeInProgress = false; return; } - if (IS_NIC_DOWN(priv)) { + if (!priv->up) { RT_TRACE(COMP_ERR, "%s(): ERR!! driver is not up\n", __func__); return; } @@ -1309,7 +1309,7 @@ void InitialGain819xPci(struct net_device *dev, u8 Operation) u32 BitMask; u8 initial_gain; - if (!IS_NIC_DOWN(priv)) { + if (priv->up) { switch (Operation) { case IG_Backup: RT_TRACE(COMP_SCAN, "IG_Backup, backup the initial" diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 7dda904..a603acc 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -1506,7 +1506,7 @@ RESET_START: if (priv->rtllib->state == RTLLIB_LINKED) LeisurePSLeave(dev); - if (IS_NIC_DOWN(priv)) { + if (priv->up) { RT_TRACE(COMP_ERR, "%s():the driver is not up! " "return\n", __func__); up(&priv->wx_sem); @@ -1650,7 +1650,7 @@ void rtl819x_watchdog_wqcallback(void *data) bool bHigherBusyRxTraffic = false; bool bEnterPS = false; - if (IS_NIC_DOWN(priv) || priv->bHwRadioOff) + if (!priv->up || priv->bHwRadioOff) return; if (priv->rtllib->state >= RTLLIB_LINKED) { @@ -1882,7 +1882,7 @@ void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, MAX_DEV_ADDR_SIZE); u8 queue_index = tcb_desc->queue_index; - if ((priv->rtllib->eRFPowerState == eRfOff) || IS_NIC_DOWN(priv) || + if ((priv->rtllib->eRFPowerState == eRfOff) || !priv->up || priv->bResetInProgress) { kfree_skb(skb); return; @@ -1916,7 +1916,7 @@ int rtl8192_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) if (queue_index != TXCMD_QUEUE) { if ((priv->rtllib->eRFPowerState == eRfOff) || - IS_NIC_DOWN(priv) || priv->bResetInProgress) { + !priv->up || priv->bResetInProgress) { kfree_skb(skb); return 0; } @@ -3032,7 +3032,7 @@ bool NicIFEnableNIC(struct net_device *dev) struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) (&(priv->rtllib->PowerSaveControl)); - if (IS_NIC_DOWN(priv)) { + if (!priv->up) { RT_TRACE(COMP_ERR, "ERR!!! %s(): Driver is already down!\n", __func__); priv->bdisable_nic = false; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h index d1438c2..113174b 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h @@ -98,8 +98,6 @@ #define BIT(_i) (1<<(_i)) #endif -#define IS_NIC_DOWN(priv) (!(priv)->up) - #define IS_ADAPTER_SENDS_BEACON(dev) 0 #define IS_UNDER_11N_AES_MODE(_rtllib) \ diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index b8891c6..bdb9274 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -267,7 +267,7 @@ static void dm_check_rate_adaptive(struct net_device *dev) bool bshort_gi_enabled = false; static u8 ping_rssi_state; - if (IS_NIC_DOWN(priv)) { + if (!priv->up) { RT_TRACE(COMP_RATE, "<---- dm_check_rate_adaptive(): driver is going to unload\n"); return; } @@ -1569,7 +1569,7 @@ void dm_restore_dynamic_mechanism_state(struct net_device *dev) u32 reg_ratr = priv->rate_adaptive.last_ratr; u32 ratr_value; - if (IS_NIC_DOWN(priv)) { + if (!priv->up) { RT_TRACE(COMP_RATE, "<---- dm_restore_dynamic_mechanism_state(): driver is going to unload\n"); return; } -- 1.9.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] Staging: rtl8192u: Fix duplicate conditional branch [not found] <cover.1425367678.git.vthakkar1994@gmail.com> 2015-03-03 7:38 ` [PATCH] Staging: rtl8192e: Eliminate use of macro IS_NIC_DOWN Vaishali Thakkar @ 2015-03-03 7:39 ` Vaishali Thakkar 2015-03-03 12:22 ` [Outreachy kernel] " Julia Lawall 1 sibling, 1 reply; 6+ messages in thread From: Vaishali Thakkar @ 2015-03-03 7:39 UTC (permalink / raw) To: outreachy-kernel Replace duplicate branch with correct value. This branch is supposed to work for low thresh value. Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> --- drivers/staging/rtl8192u/r8192U_dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 7199616..5a01b7d 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -1628,8 +1628,8 @@ void dm_change_dynamic_initgain_thresh(struct net_device *dev, u32 dm_type, dm_digtable.rssi_low_thresh = dm_value; } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_HIGH) { dm_digtable.rssi_high_power_highthresh = dm_value; - } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_HIGH) { - dm_digtable.rssi_high_power_highthresh = dm_value; + } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_LOW) { + dm_digtable.rssi_high_power_lowthresh = dm_value; } else if (dm_type == DIG_TYPE_ENABLE) { dm_digtable.dig_state = DM_STA_DIG_MAX; dm_digtable.dig_enable_flag = true; -- 1.9.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: rtl8192u: Fix duplicate conditional branch 2015-03-03 7:39 ` [PATCH] Staging: rtl8192u: Fix duplicate conditional branch Vaishali Thakkar @ 2015-03-03 12:22 ` Julia Lawall 2015-03-03 13:23 ` Vaishali Thakkar 0 siblings, 1 reply; 6+ messages in thread From: Julia Lawall @ 2015-03-03 12:22 UTC (permalink / raw) To: Vaishali Thakkar; +Cc: outreachy-kernel On Tue, 3 Mar 2015, Vaishali Thakkar wrote: > Replace duplicate branch with correct value. This branch > is supposed to work for low thresh value. How did you find the problem? julia > Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> > --- > drivers/staging/rtl8192u/r8192U_dm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c > index 7199616..5a01b7d 100644 > --- a/drivers/staging/rtl8192u/r8192U_dm.c > +++ b/drivers/staging/rtl8192u/r8192U_dm.c > @@ -1628,8 +1628,8 @@ void dm_change_dynamic_initgain_thresh(struct net_device *dev, u32 dm_type, > dm_digtable.rssi_low_thresh = dm_value; > } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_HIGH) { > dm_digtable.rssi_high_power_highthresh = dm_value; > - } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_HIGH) { > - dm_digtable.rssi_high_power_highthresh = dm_value; > + } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_LOW) { > + dm_digtable.rssi_high_power_lowthresh = dm_value; > } else if (dm_type == DIG_TYPE_ENABLE) { > dm_digtable.dig_state = DM_STA_DIG_MAX; > dm_digtable.dig_enable_flag = true; > -- > 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 outreachy-kernel+unsubscribe@googlegroups.com. > To post to this group, send email to outreachy-kernel@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1bdb9ff234b262793c0537cc9e11cf087202e61a.1425367678.git.vthakkar1994%40gmail.com. > For more options, visit https://groups.google.com/d/optout. > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: rtl8192u: Fix duplicate conditional branch 2015-03-03 12:22 ` [Outreachy kernel] " Julia Lawall @ 2015-03-03 13:23 ` Vaishali Thakkar 2015-03-03 22:34 ` Julia Lawall 0 siblings, 1 reply; 6+ messages in thread From: Vaishali Thakkar @ 2015-03-03 13:23 UTC (permalink / raw) To: Julia Lawall; +Cc: outreachy-kernel On Tue, Mar 3, 2015 at 5:52 PM, Julia Lawall <julia.lawall@lip6.fr> wrote: > On Tue, 3 Mar 2015, Vaishali Thakkar wrote: > >> Replace duplicate branch with correct value. This branch >> is supposed to work for low thresh value. > > How did you find the problem? From git log. I was looking for git log of driver rtl8192e for that setup_timer problem and saw that someone sent a patch for this. And as rtl8192u and rtl8192e follows the same structure, I just looked at file of this driver. And this problem for rtl8192u was still there. So, I just sent a patch. Also, while changing this code I found that rtl8192u is not using any macro and rtl8192e was using one useless macro. So, I sent a patch for it also. > julia > >> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> >> --- >> drivers/staging/rtl8192u/r8192U_dm.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c >> index 7199616..5a01b7d 100644 >> --- a/drivers/staging/rtl8192u/r8192U_dm.c >> +++ b/drivers/staging/rtl8192u/r8192U_dm.c >> @@ -1628,8 +1628,8 @@ void dm_change_dynamic_initgain_thresh(struct net_device *dev, u32 dm_type, >> dm_digtable.rssi_low_thresh = dm_value; >> } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_HIGH) { >> dm_digtable.rssi_high_power_highthresh = dm_value; >> - } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_HIGH) { >> - dm_digtable.rssi_high_power_highthresh = dm_value; >> + } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_LOW) { >> + dm_digtable.rssi_high_power_lowthresh = dm_value; >> } else if (dm_type == DIG_TYPE_ENABLE) { >> dm_digtable.dig_state = DM_STA_DIG_MAX; >> dm_digtable.dig_enable_flag = true; >> -- >> 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 outreachy-kernel+unsubscribe@googlegroups.com. >> To post to this group, send email to outreachy-kernel@googlegroups.com. >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1bdb9ff234b262793c0537cc9e11cf087202e61a.1425367678.git.vthakkar1994%40gmail.com. >> For more options, visit https://groups.google.com/d/optout. >> -- Vaishali ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: rtl8192u: Fix duplicate conditional branch 2015-03-03 13:23 ` Vaishali Thakkar @ 2015-03-03 22:34 ` Julia Lawall 2015-03-04 2:25 ` Vaishali Thakkar 0 siblings, 1 reply; 6+ messages in thread From: Julia Lawall @ 2015-03-03 22:34 UTC (permalink / raw) To: Vaishali Thakkar; +Cc: outreachy-kernel On Tue, 3 Mar 2015, Vaishali Thakkar wrote: > On Tue, Mar 3, 2015 at 5:52 PM, Julia Lawall <julia.lawall@lip6.fr> wrote: > > On Tue, 3 Mar 2015, Vaishali Thakkar wrote: > > > >> Replace duplicate branch with correct value. This branch > >> is supposed to work for low thresh value. > > > > How did you find the problem? > > From git log. I was looking for git log of driver rtl8192e for that setup_timer > problem and saw that someone sent a patch for this. And as rtl8192u and > rtl8192e follows the same structure, I just looked at file of this driver. And > this problem for rtl8192u was still there. So, I just sent a patch. > > Also, while changing this code I found that rtl8192u is not using any macro and > rtl8192e was using one useless macro. So, I sent a patch for it also. Good work :) julia > > julia > > > >> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> > >> --- > >> drivers/staging/rtl8192u/r8192U_dm.c | 4 ++-- > >> 1 file changed, 2 insertions(+), 2 deletions(-) > >> > >> diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c > >> index 7199616..5a01b7d 100644 > >> --- a/drivers/staging/rtl8192u/r8192U_dm.c > >> +++ b/drivers/staging/rtl8192u/r8192U_dm.c > >> @@ -1628,8 +1628,8 @@ void dm_change_dynamic_initgain_thresh(struct net_device *dev, u32 dm_type, > >> dm_digtable.rssi_low_thresh = dm_value; > >> } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_HIGH) { > >> dm_digtable.rssi_high_power_highthresh = dm_value; > >> - } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_HIGH) { > >> - dm_digtable.rssi_high_power_highthresh = dm_value; > >> + } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_LOW) { > >> + dm_digtable.rssi_high_power_lowthresh = dm_value; > >> } else if (dm_type == DIG_TYPE_ENABLE) { > >> dm_digtable.dig_state = DM_STA_DIG_MAX; > >> dm_digtable.dig_enable_flag = true; > >> -- > >> 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 outreachy-kernel+unsubscribe@googlegroups.com. > >> To post to this group, send email to outreachy-kernel@googlegroups.com. > >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1bdb9ff234b262793c0537cc9e11cf087202e61a.1425367678.git.vthakkar1994%40gmail.com. > >> For more options, visit https://groups.google.com/d/optout. > >> > > > > -- > Vaishali > > -- > 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 outreachy-kernel+unsubscribe@googlegroups.com. > To post to this group, send email to outreachy-kernel@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAK-LDbKcVLuoedmX-HJxaeR9ZkY9ZNXdx%2Bj7xzu1kx3%2BpmuyXA%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: rtl8192u: Fix duplicate conditional branch 2015-03-03 22:34 ` Julia Lawall @ 2015-03-04 2:25 ` Vaishali Thakkar 0 siblings, 0 replies; 6+ messages in thread From: Vaishali Thakkar @ 2015-03-04 2:25 UTC (permalink / raw) To: Julia Lawall; +Cc: outreachy-kernel On Wed, Mar 4, 2015 at 4:04 AM, Julia Lawall <julia.lawall@lip6.fr> wrote: > On Tue, 3 Mar 2015, Vaishali Thakkar wrote: > >> On Tue, Mar 3, 2015 at 5:52 PM, Julia Lawall <julia.lawall@lip6.fr> wrote: >> > On Tue, 3 Mar 2015, Vaishali Thakkar wrote: >> > >> >> Replace duplicate branch with correct value. This branch >> >> is supposed to work for low thresh value. >> > >> > How did you find the problem? >> >> From git log. I was looking for git log of driver rtl8192e for that setup_timer >> problem and saw that someone sent a patch for this. And as rtl8192u and >> rtl8192e follows the same structure, I just looked at file of this driver. And >> this problem for rtl8192u was still there. So, I just sent a patch. >> >> Also, while changing this code I found that rtl8192u is not using any macro and >> rtl8192e was using one useless macro. So, I sent a patch for it also. > > Good work :) Thank You. :) > julia > >> > julia >> > >> >> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> >> >> --- >> >> drivers/staging/rtl8192u/r8192U_dm.c | 4 ++-- >> >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> >> >> diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c >> >> index 7199616..5a01b7d 100644 >> >> --- a/drivers/staging/rtl8192u/r8192U_dm.c >> >> +++ b/drivers/staging/rtl8192u/r8192U_dm.c >> >> @@ -1628,8 +1628,8 @@ void dm_change_dynamic_initgain_thresh(struct net_device *dev, u32 dm_type, >> >> dm_digtable.rssi_low_thresh = dm_value; >> >> } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_HIGH) { >> >> dm_digtable.rssi_high_power_highthresh = dm_value; >> >> - } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_HIGH) { >> >> - dm_digtable.rssi_high_power_highthresh = dm_value; >> >> + } else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_LOW) { >> >> + dm_digtable.rssi_high_power_lowthresh = dm_value; >> >> } else if (dm_type == DIG_TYPE_ENABLE) { >> >> dm_digtable.dig_state = DM_STA_DIG_MAX; >> >> dm_digtable.dig_enable_flag = true; >> >> -- >> >> 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 outreachy-kernel+unsubscribe@googlegroups.com. >> >> To post to this group, send email to outreachy-kernel@googlegroups.com. >> >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1bdb9ff234b262793c0537cc9e11cf087202e61a.1425367678.git.vthakkar1994%40gmail.com. >> >> For more options, visit https://groups.google.com/d/optout. >> >> >> >> >> >> -- >> Vaishali >> >> -- >> 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 outreachy-kernel+unsubscribe@googlegroups.com. >> To post to this group, send email to outreachy-kernel@googlegroups.com. >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAK-LDbKcVLuoedmX-HJxaeR9ZkY9ZNXdx%2Bj7xzu1kx3%2BpmuyXA%40mail.gmail.com. >> For more options, visit https://groups.google.com/d/optout. >> -- Vaishali ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-03-04 2:25 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <cover.1425367678.git.vthakkar1994@gmail.com> 2015-03-03 7:38 ` [PATCH] Staging: rtl8192e: Eliminate use of macro IS_NIC_DOWN Vaishali Thakkar 2015-03-03 7:39 ` [PATCH] Staging: rtl8192u: Fix duplicate conditional branch Vaishali Thakkar 2015-03-03 12:22 ` [Outreachy kernel] " Julia Lawall 2015-03-03 13:23 ` Vaishali Thakkar 2015-03-03 22:34 ` Julia Lawall 2015-03-04 2:25 ` Vaishali Thakkar
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.