[PATCH] staging: rtl8723bs: Use shared header constants

Dan Carpenter dan.carpenter at oracle.com
Thu May 28 09:16:07 UTC 2020


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 at oracle.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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rename_rev.pl
Type: text/x-perl
Size: 11192 bytes
Desc: not available
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20200528/944c3c22/attachment.pl>


More information about the devel mailing list