* [PATCH] staging: rtlwifi: Remove unnecessary variable @ 2018-10-22 4:17 Maya Nakamura 2018-10-22 7:08 ` [Outreachy kernel] " Julia Lawall 0 siblings, 1 reply; 4+ messages in thread From: Maya Nakamura @ 2018-10-22 4:17 UTC (permalink / raw) To: gregkh, outreachy-kernel Remove an unnecessary variable that is declared and assigned a value only to return it. Issue found by Coccinelle's semantic patch results for returnvar.cocci. Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com> --- drivers/staging/rtlwifi/phydm/phydm_hwconfig.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c b/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c index 90a41c64c0c2..fdc9af56e9d7 100644 --- a/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c +++ b/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c @@ -491,8 +491,7 @@ static u8 odm_sq_process_patch_rt_cid_819x_lenovo(struct phy_dm_struct *dm, u8 is_cck_rate, u8 pwdb_all, u8 path, u8 RSSI) { - u8 sq = 0; - return sq; + return 0; } static u8 odm_evm_db_to_percentage(s8 value) -- 2.17.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: rtlwifi: Remove unnecessary variable 2018-10-22 4:17 [PATCH] staging: rtlwifi: Remove unnecessary variable Maya Nakamura @ 2018-10-22 7:08 ` Julia Lawall 2018-10-22 23:17 ` Maya Nakamura 0 siblings, 1 reply; 4+ messages in thread From: Julia Lawall @ 2018-10-22 7:08 UTC (permalink / raw) To: Maya Nakamura; +Cc: gregkh, outreachy-kernel On Sun, 21 Oct 2018, Maya Nakamura wrote: > Remove an unnecessary variable that is declared and assigned a value only > to return it. Issue found by Coccinelle's semantic patch results for > returnvar.cocci. Just looking around in this code, just above there is a function with double { { } } that could be cleaned up. Looking further, in phydm_process_rssi_ofdm there appear to be variables with parentheses around them. Maybe you can look around in this file for other things to clean up. The following does not look so good either: if (entry->rssi_stat.ofdm_pkt == 64) { /* speed up when all packets are OFDM*/ julia > > Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com> > --- > drivers/staging/rtlwifi/phydm/phydm_hwconfig.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c b/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c > index 90a41c64c0c2..fdc9af56e9d7 100644 > --- a/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c > +++ b/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c > @@ -491,8 +491,7 @@ static u8 odm_sq_process_patch_rt_cid_819x_lenovo(struct phy_dm_struct *dm, > u8 is_cck_rate, u8 pwdb_all, > u8 path, u8 RSSI) > { > - u8 sq = 0; > - return sq; > + return 0; > } > > static u8 odm_evm_db_to_percentage(s8 value) > -- > 2.17.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/20181022041747.GA2618%40k-vBox. > For more options, visit https://groups.google.com/d/optout. > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: rtlwifi: Remove unnecessary variable 2018-10-22 7:08 ` [Outreachy kernel] " Julia Lawall @ 2018-10-22 23:17 ` Maya Nakamura 2018-10-23 5:40 ` Julia Lawall 0 siblings, 1 reply; 4+ messages in thread From: Maya Nakamura @ 2018-10-22 23:17 UTC (permalink / raw) To: Julia Lawall; +Cc: gregkh, outreachy-kernel On Mon, Oct 22, 2018 at 08:08:10AM +0100, Julia Lawall wrote: > > > On Sun, 21 Oct 2018, Maya Nakamura wrote: > > > Remove an unnecessary variable that is declared and assigned a value only > > to return it. Issue found by Coccinelle's semantic patch results for > > returnvar.cocci. > > Just looking around in this code, just above there is a function with > double { { } } that could be cleaned up. > > Looking further, in phydm_process_rssi_ofdm there appear to be variables > with parentheses around them. Maybe you can look around in this file for > other things to clean up. > > The following does not look so good either: > > if (entry->rssi_stat.ofdm_pkt == > 64) { /* speed up when all packets are OFDM*/ > > julia Thank you for explaining to me what more I can do with the same file! I will look for more and resubmit this patch, or I might be able to try my first patchset. Maya > > > > Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com> > > --- > > drivers/staging/rtlwifi/phydm/phydm_hwconfig.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c b/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c > > index 90a41c64c0c2..fdc9af56e9d7 100644 > > --- a/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c > > +++ b/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c > > @@ -491,8 +491,7 @@ static u8 odm_sq_process_patch_rt_cid_819x_lenovo(struct phy_dm_struct *dm, > > u8 is_cck_rate, u8 pwdb_all, > > u8 path, u8 RSSI) > > { > > - u8 sq = 0; > > - return sq; > > + return 0; > > } > > > > static u8 odm_evm_db_to_percentage(s8 value) > > -- > > 2.17.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/20181022041747.GA2618%40k-vBox. > > 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 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/alpine.DEB.2.21.1810220805200.2325%40hadrien. > For more options, visit https://groups.google.com/d/optout. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: rtlwifi: Remove unnecessary variable 2018-10-22 23:17 ` Maya Nakamura @ 2018-10-23 5:40 ` Julia Lawall 0 siblings, 0 replies; 4+ messages in thread From: Julia Lawall @ 2018-10-23 5:40 UTC (permalink / raw) To: Maya Nakamura; +Cc: gregkh, outreachy-kernel On Mon, 22 Oct 2018, Maya Nakamura wrote: > On Mon, Oct 22, 2018 at 08:08:10AM +0100, Julia Lawall wrote: > > > > > > On Sun, 21 Oct 2018, Maya Nakamura wrote: > > > > > Remove an unnecessary variable that is declared and assigned a value only > > > to return it. Issue found by Coccinelle's semantic patch results for > > > returnvar.cocci. > > > > Just looking around in this code, just above there is a function with > > double { { } } that could be cleaned up. > > > > Looking further, in phydm_process_rssi_ofdm there appear to be variables > > with parentheses around them. Maybe you can look around in this file for > > other things to clean up. > > > > The following does not look so good either: > > > > if (entry->rssi_stat.ofdm_pkt == > > 64) { /* speed up when all packets are OFDM*/ > > > > julia > > Thank you for explaining to me what more I can do with the same file! > I will look for more and resubmit this patch, or I might be able to > try my first patchset. Make a patchset, because these are different issues. julia > > Maya > > > > > > > Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com> > > > --- > > > drivers/staging/rtlwifi/phydm/phydm_hwconfig.c | 3 +-- > > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > > > diff --git a/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c b/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c > > > index 90a41c64c0c2..fdc9af56e9d7 100644 > > > --- a/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c > > > +++ b/drivers/staging/rtlwifi/phydm/phydm_hwconfig.c > > > @@ -491,8 +491,7 @@ static u8 odm_sq_process_patch_rt_cid_819x_lenovo(struct phy_dm_struct *dm, > > > u8 is_cck_rate, u8 pwdb_all, > > > u8 path, u8 RSSI) > > > { > > > - u8 sq = 0; > > > - return sq; > > > + return 0; > > > } > > > > > > static u8 odm_evm_db_to_percentage(s8 value) > > > -- > > > 2.17.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/20181022041747.GA2618%40k-vBox. > > > 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 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/alpine.DEB.2.21.1810220805200.2325%40hadrien. > > 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 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/20181022231706.GA2384%40k-vBox. > For more options, visit https://groups.google.com/d/optout. > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-10-23 5:40 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-10-22 4:17 [PATCH] staging: rtlwifi: Remove unnecessary variable Maya Nakamura 2018-10-22 7:08 ` [Outreachy kernel] " Julia Lawall 2018-10-22 23:17 ` Maya Nakamura 2018-10-23 5:40 ` Julia Lawall
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.