[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200528091607.GN22511@kadam>
Date: Thu, 28 May 2020 12:16:07 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Pascal Terjan <pterjan@...gle.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: Use shared header constants
On Wed, May 27, 2020 at 09:33:03PM +0100, Pascal Terjan wrote:
> On Wed, 27 May 2020 at 20:48, Dan Carpenter <dan.carpenter@...cle.com> wrote:
> > > /* eth_type = (psnap_type[0] << 8) | psnap_type[1]; */
> > > - if ((!memcmp(psnap, rtw_rfc1042_header, SNAP_SIZE) &&
> > > - (memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2)) &&
> > > - (memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_AARP, 2))) ||
> > > - /* eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || */
> > > - !memcmp(psnap, rtw_bridge_tunnel_header, SNAP_SIZE)) {
> > > + if ((!memcmp(psnap, rfc1042_header, SNAP_SIZE) &&
> > > + memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) &&
> > > + memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_AARP, 2)) ||
> > > + /* eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || */
> > > + !memcmp(psnap, bridge_tunnel_header, SNAP_SIZE)) {
> > > /* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */
> > > bsnaphdr = true;
> >
> > Your indenting is correct, but I would probably do that in a separate
> > patch. It makes it harder to review. Also probably delete the
> > commented out code. Do you see how if we don't touch the indenting then
> > it doesn't raise the question about if we should delete the comments as
> > well?
>
> I initially didn't want to change it but checkpatch was sad which
> makes me sad, maybe I should have cleaned up this area in a first
> trivial patch before touching that line.
Just ignore checkpatch in this case because it's not a warning that your
patch introduced.
Say if you re-name a function, then you *must* re-indent the parameters
because that's a warning the change introduces. If there is a
checkpatch warning and it's on a line that you touch then you can change
that. But once you start changing other nearby lines you might run into
trouble.
The other thing that you fixed is you removed unnecessary parentheses
and that's good but it actually broke my review script for renaming
variables. (Attached). I do `cat email.txt | rename_rev.pl -a` It's
easier in mutt.
regards,
dan carpenter
View attachment "rename_rev.pl" of type "text/x-perl" (11193 bytes)
Powered by blists - more mailing lists