* [Outreachy kernel] [PATCH] staging: rtl8723bs: Remove unnecessary parentheses @ 2019-03-28 14:03 Payal Kshirsagar 2019-03-28 14:26 ` Julia Lawall 0 siblings, 1 reply; 3+ messages in thread From: Payal Kshirsagar @ 2019-03-28 14:03 UTC (permalink / raw) To: outreachy-kernel; +Cc: Payal Kshirsagar Challenge suggested by coccinelle This patch removes unnecessary parentheses while returning a value. Using following semantic patch: @@ local idexpression id; @@ - return(id); + return id; Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.c> --- diff -u -p a/os_dep/ioctl_linux.c b/os_dep/ioctl_linux.c --- a/os_dep/ioctl_linux.c +++ b/os_dep/ioctl_linux.c @@ -961,7 +961,7 @@ static int rtw_wx_set_pmkid(struct net_d if (pPMK->cmd == IW_PMKSA_ADD) { DBG_871X("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n"); if (!memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN)) - return(intReturn); + return intReturn; else intReturn = true; @@ -1489,7 +1489,7 @@ exit: DBG_871X("DBG_IOCTL %s:%d return %d\n", __func__, __LINE__, ret); #endif - return ret ; + return ret; } ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: rtl8723bs: Remove unnecessary parentheses 2019-03-28 14:03 [Outreachy kernel] [PATCH] staging: rtl8723bs: Remove unnecessary parentheses Payal Kshirsagar @ 2019-03-28 14:26 ` Julia Lawall 2019-03-28 14:34 ` Payal Kshirsagar 0 siblings, 1 reply; 3+ messages in thread From: Julia Lawall @ 2019-03-28 14:26 UTC (permalink / raw) To: Payal Kshirsagar; +Cc: outreachy-kernel, Payal Kshirsagar On Thu, 28 Mar 2019, Payal Kshirsagar wrote: > Challenge suggested by coccinelle > > This patch removes unnecessary parentheses while returning a value. > Using following semantic patch: > > @@ > local idexpression id; > @@ > > - return(id); > + return id; > > Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.c> > --- > diff -u -p a/os_dep/ioctl_linux.c b/os_dep/ioctl_linux.c > --- a/os_dep/ioctl_linux.c > +++ b/os_dep/ioctl_linux.c > @@ -961,7 +961,7 @@ static int rtw_wx_set_pmkid(struct net_d > if (pPMK->cmd == IW_PMKSA_ADD) { > DBG_871X("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n"); > if (!memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN)) > - return(intReturn); > + return intReturn; > else > intReturn = true; > > @@ -1489,7 +1489,7 @@ exit: > DBG_871X("DBG_IOCTL %s:%d return %d\n", __func__, __LINE__, ret); > #endif > > - return ret ; > + return ret; There are two kinds of change: one drops parentheses and one drops a space. Both are good, but they should be in two separate patches. The second one is because Coccinelle implicitly ignores parentheses, unless you tell it not to, so it actually matches and repretty prints all returns. In the second case it caused a change. julia > > } > > > -- > 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/1553781808-10349-1-git-send-email-payal.s.kshirsagar.98%40gmail.com. > For more options, visit https://groups.google.com/d/optout. > ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: rtl8723bs: Remove unnecessary parentheses 2019-03-28 14:26 ` Julia Lawall @ 2019-03-28 14:34 ` Payal Kshirsagar 0 siblings, 0 replies; 3+ messages in thread From: Payal Kshirsagar @ 2019-03-28 14:34 UTC (permalink / raw) To: Julia Lawall; +Cc: outreachy-kernel [-- Attachment #1: Type: text/plain, Size: 2701 bytes --] On Thu, Mar 28, 2019, 7:57 PM Julia Lawall <julia.lawall@lip6.fr> wrote: > > > On Thu, 28 Mar 2019, Payal Kshirsagar wrote: > > > Challenge suggested by coccinelle > > > > This patch removes unnecessary parentheses while returning a value. > > Using following semantic patch: > > > > @@ > > local idexpression id; > > @@ > > > > - return(id); > > + return id; > > > > Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.c> > > --- > > diff -u -p a/os_dep/ioctl_linux.c b/os_dep/ioctl_linux.c > > --- a/os_dep/ioctl_linux.c > > +++ b/os_dep/ioctl_linux.c > > @@ -961,7 +961,7 @@ static int rtw_wx_set_pmkid(struct net_d > > if (pPMK->cmd == IW_PMKSA_ADD) { > > DBG_871X("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n"); > > if (!memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN)) > > - return(intReturn); > > + return intReturn; > > else > > intReturn = true; > > > > @@ -1489,7 +1489,7 @@ exit: > > DBG_871X("DBG_IOCTL %s:%d return %d\n", __func__, __LINE__, ret); > > #endif > > > > - return ret ; > > + return ret; > > There are two kinds of change: one drops parentheses and one drops a > space. Both are good, but they should be in two separate patches. > Okay, I will put them in different patches and will send it again. Thanks, Payal The second one is because Coccinelle implicitly ignores parentheses, > unless you tell it not to, so it actually matches and repretty prints all > returns. In the second case it caused a change. > > julia > > > > > } > > > > > > -- > > 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/1553781808-10349-1-git-send-email-payal.s.kshirsagar.98%40gmail.com > . > > 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.1903281525280.2438%40hadrien > . > For more options, visit https://groups.google.com/d/optout. > [-- Attachment #2: Type: text/html, Size: 4742 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-28 14:34 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-03-28 14:03 [Outreachy kernel] [PATCH] staging: rtl8723bs: Remove unnecessary parentheses Payal Kshirsagar 2019-03-28 14:26 ` Julia Lawall 2019-03-28 14:34 ` Payal Kshirsagar
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.