[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1910202123110.10441@hadrien>
Date: Sun, 20 Oct 2019 21:29:02 +0200 (CEST)
From: Julia Lawall <julia.lawall@...6.fr>
To: Dan Carpenter <dan.carpenter@...cle.com>
cc: Joe Perches <joe@...ches.com>, Jules Irenge <jbi.octave@...il.com>,
devel@...verdev.osuosl.org, outreachy-kernel@...glegroups.com,
linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org
Subject: Re: [Outreachy kernel] Re: [PATCH v1 1/5] staging: wfx: fix warnings
of no space is necessary
On Sun, 20 Oct 2019, Dan Carpenter wrote:
> On Sat, Oct 19, 2019 at 01:02:31PM -0700, Joe Perches wrote:
> > diff -u -p a/rtl8723bs/core/rtw_mlme_ext.c b/rtl8723bs/core/rtw_mlme_ext.c
> > --- a/rtl8723bs/core/rtw_mlme_ext.c
> > +++ b/rtl8723bs/core/rtw_mlme_ext.c
> > @@ -1132,7 +1132,7 @@ unsigned int OnAuthClient(struct adapter
> > goto authclnt_fail;
> > }
> >
> > - memcpy((void *)(pmlmeinfo->chg_txt), (void *)(p + 2), len);
> > + memcpy((void *)(pmlmeinfo->chg_txt), (p + 2), len);
>
> I wonder why it didn't remove the first void cast?
If "it" is a semantic patch, it is probably because Coccinelle wasn't able
to find the definition of the type of pmlmeinfo. By default, Coccinelle
only consults a few header files (ones with the same names as the .c file
or ones included with "" and located in the same directory).
>
> [ The rest of the email is bonus comments for outreachy developers ].
>
> And someone needs to check the final patch probably to remove the extra
> parentheses around "(p + 2)". Those were necessary when for the cast
> but not required after the cast is gone.
The rule could have contained
- (void *)(e)
+ e
That should also match cases with no parentheses. I think there is even
something to put the parentheses back if they are needed, but overall the
final patch should be checked carefully in any case.
julia
>
> > pmlmeinfo->auth_seq = 3;
> > issue_auth(padapter, NULL, 0);
> > set_link_timer(pmlmeext, REAUTH_TO);
>
> It's sort of tricky to know what "one thing per patch means".
>
> - memset((void *)(&(pHTInfo->SelfHTCap)), 0,
> + memset((&(pHTInfo->SelfHTCap)), 0,
> sizeof(pHTInfo->SelfHTCap));
>
> Here the parentheses were never related to the cast so we should leave
> them as is. In other words, in the first example, if we didn't remove
> the cast that would be "half a thing per patch" and in the second
> example that would be "two things in one patch".
>
> regards,
> dan carpenter
>
> --
> 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@...glegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20191020191759.GJ24678%40kadam.
>
Powered by blists - more mailing lists