lkml.org 
[lkml]   [2020]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: rtl8723bs: Use shared header constants
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

\
 
 \ /
  Last update: 2020-05-27 21:49    [W:0.069 / U:4.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site