All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Pascal Terjan <pterjan@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: Use shared header constants
Date: Wed, 27 May 2020 22:48:11 +0300	[thread overview]
Message-ID: <20200527194811.GF30374@kadam> (raw)
In-Reply-To: <20200523212919.33181-1-pterjan@google.com>

On Sat, May 23, 2020 at 10:29:19PM +0100, Pascal Terjan wrote:
> This is one of the 9 drivers redefining rfc1042_header.
> 

This is how the patch looks like in my email client:

https://marc.info/?l=linux-driver-devel&m=159026973821890&w=2

Do you see how the subject is far away from the body of the commit
message?  I normally only read the subject or the body when I'm
reviewing patches so it's good if the body is clear on its own.  Maybe
write something like:

"This driver creates a local definitions of "rtw_rfc1042_header" and
"rtw_bridge_tunnel_header" but it should just use the standard definitions
from cfg80211.h."

>  void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
> @@ -1625,11 +1622,11 @@ sint wlanhdr_to_ethhdr(union recv_frame *precvframe)
>  	psnap_type = ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE;
>  	/* convert hdr + possible LLC headers into Ethernet header */
>  	/* 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?

regards,
dan carpenter


WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Pascal Terjan <pterjan@google.com>
Cc: devel@driverdev.osuosl.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: Use shared header constants
Date: Wed, 27 May 2020 22:48:11 +0300	[thread overview]
Message-ID: <20200527194811.GF30374@kadam> (raw)
In-Reply-To: <20200523212919.33181-1-pterjan@google.com>

On Sat, May 23, 2020 at 10:29:19PM +0100, Pascal Terjan wrote:
> This is one of the 9 drivers redefining rfc1042_header.
> 

This is how the patch looks like in my email client:

https://marc.info/?l=linux-driver-devel&m=159026973821890&w=2

Do you see how the subject is far away from the body of the commit
message?  I normally only read the subject or the body when I'm
reviewing patches so it's good if the body is clear on its own.  Maybe
write something like:

"This driver creates a local definitions of "rtw_rfc1042_header" and
"rtw_bridge_tunnel_header" but it should just use the standard definitions
from cfg80211.h."

>  void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
> @@ -1625,11 +1622,11 @@ sint wlanhdr_to_ethhdr(union recv_frame *precvframe)
>  	psnap_type = ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE;
>  	/* convert hdr + possible LLC headers into Ethernet header */
>  	/* 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?

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2020-05-27 19:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-23 21:29 [PATCH] staging: rtl8723bs: Use shared header constants Pascal Terjan
2020-05-23 21:29 ` Pascal Terjan
2020-05-27  8:15 ` Greg Kroah-Hartman
2020-05-27  8:15   ` Greg Kroah-Hartman
2020-05-27 19:48 ` Dan Carpenter [this message]
2020-05-27 19:48   ` Dan Carpenter
2020-05-27 20:33   ` Pascal Terjan
2020-05-27 20:33     ` Pascal Terjan
2020-05-28  9:16     ` Dan Carpenter
2020-05-28  9:16       ` Dan Carpenter
2020-05-27 20:51   ` [PATCH v2] staging: rtl8723bs: Use common packet " Pascal Terjan
2020-05-27 20:51     ` Pascal Terjan
2020-05-28 10:04     ` Dan Carpenter
2020-05-28 10:04       ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200527194811.GF30374@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pterjan@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.