* [PATCH] vlan: cleanup the usage of *vlan in vlan_dev_hard_header
@ 2013-08-01 6:10 Wang Sheng-Hui
2013-08-01 20:12 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Wang Sheng-Hui @ 2013-08-01 6:10 UTC (permalink / raw)
To: Patrick McHardy, David S. Miller, netdev
We can use vlan directly after we get the pointer at the beginning
*vlan = vlan_dev_priv(dev)
and do not use vlan_dev_priv(dev) to access its fields afterwards.
Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
---
net/8021q/vlan_dev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 1cd3d2a..9ab8a7e 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -107,10 +107,10 @@ static int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
u16 vlan_tci = 0;
int rc;
- if (!(vlan_dev_priv(dev)->flags & VLAN_FLAG_REORDER_HDR)) {
+ if (!(vlan->flags & VLAN_FLAG_REORDER_HDR)) {
vhdr = (struct vlan_hdr *) skb_push(skb, VLAN_HLEN);
- vlan_tci = vlan_dev_priv(dev)->vlan_id;
+ vlan_tci = vlan->vlan_id;
vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb);
vhdr->h_vlan_TCI = htons(vlan_tci);
@@ -133,7 +133,7 @@ static int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
saddr = dev->dev_addr;
/* Now make the underlying real hard header */
- dev = vlan_dev_priv(dev)->real_dev;
+ dev = vlan->real_dev;
rc = dev_hard_header(skb, dev, type, daddr, saddr, len + vhdrlen);
if (rc > 0)
rc += vhdrlen;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] vlan: cleanup the usage of *vlan in vlan_dev_hard_header
2013-08-01 6:10 [PATCH] vlan: cleanup the usage of *vlan in vlan_dev_hard_header Wang Sheng-Hui
@ 2013-08-01 20:12 ` David Miller
2013-08-01 23:58 ` Wang Sheng-Hui
0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2013-08-01 20:12 UTC (permalink / raw)
To: shhuiw; +Cc: kaber, netdev
From: Wang Sheng-Hui <shhuiw@gmail.com>
Date: Thu, 01 Aug 2013 14:10:23 +0800
> We can use vlan directly after we get the pointer at the beginning
> *vlan = vlan_dev_priv(dev)
> and do not use vlan_dev_priv(dev) to access its fields afterwards.
>
> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
This patch was corrupted by your email client.
Please read Documentation/email-clients.txt to learn how to
fix this, send a test patch to yourself, and only when you
can successfully apply the patch you receive in that test email
should you repost your patch again here.
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] vlan: cleanup the usage of *vlan in vlan_dev_hard_header
2013-08-01 20:12 ` David Miller
@ 2013-08-01 23:58 ` Wang Sheng-Hui
2013-08-02 0:12 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Wang Sheng-Hui @ 2013-08-01 23:58 UTC (permalink / raw)
To: David Miller; +Cc: kaber, netdev
On 2013年08月02日 04:12, David Miller wrote:
> From: Wang Sheng-Hui <shhuiw@gmail.com>
> Date: Thu, 01 Aug 2013 14:10:23 +0800
>
>> We can use vlan directly after we get the pointer at the beginning
>> *vlan = vlan_dev_priv(dev)
>> and do not use vlan_dev_priv(dev) to access its fields afterwards.
>>
>> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
>
> This patch was corrupted by your email client.
>
Sorry. Please recheck the patch below.
> Please read Documentation/email-clients.txt to learn how to
> fix this, send a test patch to yourself, and only when you
> can successfully apply the patch you receive in that test email
> should you repost your patch again here.
>
> Thanks.
We can use vlan directly after we get the pointer at the beginning
*vlan = vlan_dev_priv(dev)
and do not use vlan_dev_priv(dev) to access its fields afterwords.
Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
---
net/8021q/vlan_dev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 1cd3d2a..9ab8a7e 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -107,10 +107,10 @@ static int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
u16 vlan_tci = 0;
int rc;
- if (!(vlan_dev_priv(dev)->flags & VLAN_FLAG_REORDER_HDR)) {
+ if (!(vlan->flags & VLAN_FLAG_REORDER_HDR)) {
vhdr = (struct vlan_hdr *) skb_push(skb, VLAN_HLEN);
- vlan_tci = vlan_dev_priv(dev)->vlan_id;
+ vlan_tci = vlan->vlan_id;
vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb);
vhdr->h_vlan_TCI = htons(vlan_tci);
@@ -133,7 +133,7 @@ static int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
saddr = dev->dev_addr;
/* Now make the underlying real hard header */
- dev = vlan_dev_priv(dev)->real_dev;
+ dev = vlan->real_dev;
rc = dev_hard_header(skb, dev, type, daddr, saddr, len + vhdrlen);
if (rc > 0)
rc += vhdrlen;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] vlan: cleanup the usage of *vlan in vlan_dev_hard_header
2013-08-01 23:58 ` Wang Sheng-Hui
@ 2013-08-02 0:12 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-08-02 0:12 UTC (permalink / raw)
To: shhuiw; +Cc: kaber, netdev
From: Wang Sheng-Hui <shhuiw@gmail.com>
Date: Fri, 02 Aug 2013 07:58:46 +0800
> On 2013年08月02日 04:12, David Miller wrote:
>> From: Wang Sheng-Hui <shhuiw@gmail.com>
>> Date: Thu, 01 Aug 2013 14:10:23 +0800
>>
>>> We can use vlan directly after we get the pointer at the beginning
>>> *vlan = vlan_dev_priv(dev)
>>> and do not use vlan_dev_priv(dev) to access its fields afterwards.
>>>
>>> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
>>
>> This patch was corrupted by your email client.
>>
>
> Sorry. Please recheck the patch below.
Please make a fresh patch posting, don't use a reply to this thread.
Thank you.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-08-02 0:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-01 6:10 [PATCH] vlan: cleanup the usage of *vlan in vlan_dev_hard_header Wang Sheng-Hui
2013-08-01 20:12 ` David Miller
2013-08-01 23:58 ` Wang Sheng-Hui
2013-08-02 0:12 ` David Miller
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).