netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
To: davem@davemloft.net, kvalo@codeaurora.org,
	johannes@sipsolutions.net, netdev@vger.kernel.org
Subject: [net-next 4/4] wireless: use reset to set mac header
Date: Tue,  1 Mar 2016 09:27:38 +0000	[thread overview]
Message-ID: <1456824458-19499-5-git-send-email-zhangshengju@cmss.chinamobile.com> (raw)
In-Reply-To: <1456824458-19499-1-git-send-email-zhangshengju@cmss.chinamobile.com>

Since offset is zeor, it's not necessary to use set function. Reset
function is straightforward, and will remove the unnecessary add
operation in set function.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
---
 net/wireless/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index 9277042..7d26eac 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -636,7 +636,7 @@ int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr,
 	/* Update skb pointers to various headers since this modified frame
 	 * is going to go through Linux networking code that may potentially
 	 * need things like pointer to IP header. */
-	skb_set_mac_header(skb, 0);
+	skb_reset_mac_header(skb);
 	skb_set_network_header(skb, nh_pos);
 	skb_set_transport_header(skb, h_pos);
 
-- 
1.8.3.1

      parent reply	other threads:[~2016-03-01  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01  9:27 [net-next 0/4] use reset to set header pointers Zhang Shengju
2016-03-01  9:27 ` [net-next 1/4] vxlan: " Zhang Shengju
2016-03-01 14:39   ` Sergei Shtylyov
2016-03-01  9:27 ` [net-next 2/4] mac80211_hwsim: use reset to set mac header Zhang Shengju
2016-03-01  9:27 ` [net-next 3/4] mac80211: use reset to set header pointer Zhang Shengju
2016-03-01  9:27 ` Zhang Shengju [this message]

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=1456824458-19499-5-git-send-email-zhangshengju@cmss.chinamobile.com \
    --to=zhangshengju@cmss.chinamobile.com \
    --cc=davem@davemloft.net \
    --cc=johannes@sipsolutions.net \
    --cc=kvalo@codeaurora.org \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).