Skip to contentSkip to conversation

tg3: use <linux/io.h> and <linux/uaccess.h> instead <asm/io.h> and <asm/uaccess.h>

PATCH Applied Javier Martinez Canillas 3 participants 7 messages Mar 27, 2011 – Mar 28, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 tg3: use <linux/io.h> and <linux/uaccess.h> instead <asm/io.h> and <asm/uaccess.h>

It is proper style to include linux/foo.h instead asm/foo.h if both exist

---
 drivers/net/tg3.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/tg3.c +2 -2
index 6be4185..4410d73 100644
@@ -48,9 +48,9 @@
 #include <net/ip.h>
 
 #include <asm/system.h>
-#include <asm/io.h>
+#include <linux/io.h>
 #include <asm/byteorder.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 
 #ifdef CONFIG_SPARC
 #include <asm/idprom.h>
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH 2/3 tg3: Don't use IRQF_SAMPLE_RANDOM

This flag is scheduled for removal so we shouldn't used it.

---
 drivers/net/tg3.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/tg3.c +2 -3
index c67eb19..58c6049 100644
@@ -8844,12 +8844,11 @@ static int tg3_request_irq(struct tg3 *tp, int irq_num)
 		fn = tg3_msi;
 		if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)
 			fn = tg3_msi_1shot;
-		flags = IRQF_SAMPLE_RANDOM;
 	} else {
 		fn = tg3_interrupt;
 		if (tp->tg3_flags & TG3_FLAG_TAGGED_STATUS)
 			fn = tg3_interrupt_tagged;
-		flags = IRQF_SHARED | IRQF_SAMPLE_RANDOM;
+		flags = IRQF_SHARED;
 	}
 
 	return request_irq(tnapi->irq_vec, fn, flags, name, tnapi);
@@ -8880,7 +8879,7 @@ static int tg3_test_interrupt(struct tg3 *tp)
 	}
 
 	err = request_irq(tnapi->irq_vec, tg3_test_isr,
-			  IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, tnapi);
+			  IRQF_SHARED, dev->name, tnapi);
 	if (err)
 		return err;
 
Signature · 1 line
1.7.2.3
#4 lore raw

PATCH 3/3 tg3: Fix inline keyword usage

In reply to Javier Martinez Canillas

The correct usage is "static inline void" not "static void inline".

---
 drivers/net/tg3.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/tg3.c +1 -1
index 58c6049..d7e564d 100644
@@ -13061,7 +13061,7 @@ done:
 
 static struct pci_dev * __devinit tg3_find_peer(struct tg3 *);
 
-static void inline vlan_features_add(struct net_device *dev, unsigned long flags)
+static inline void vlan_features_add(struct net_device *dev, unsigned long flags)
 {
 	dev->vlan_features |= flags;
 }
Signature · 1 line
1.7.2.3
#2 lore raw

Re: [PATCH 2/3] tg3: Don't use IRQF_SAMPLE_RANDOM

In reply to Javier Martinez Canillas
Quoted 12 lines · Javier Martinez Canillas

This flag is scheduled for removal so we shouldn't used it.

---
 drivers/net/tg3.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/tg3.c +0 -0
index c67eb19..58c6049 100644

drivers/net/tg3.c static int tg3_request_irq(struct tg3 *tp, int irq_num) · line 8847

Quoted 4 lines
drivers/net/tg3.c +0 -1
@@ -8844,12 +8844,11 @@ static int tg3_request_irq(struct tg3 *tp, int irq_num)
 		fn = tg3_msi;
 		if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)
 			fn = tg3_msi_1shot;
-		flags = IRQF_SAMPLE_RANDOM;

You need initialize flags to zero here. Apparently gcc doesn't catch this. I'm using gcc 4.4.3-4ubuntu5.

regards,
dan carpenter
v

Quoted 9 lines
drivers/net/tg3.c +1 -1
 	} else {
 		fn = tg3_interrupt;
 		if (tp->tg3_flags & TG3_FLAG_TAGGED_STATUS)
 			fn = tg3_interrupt_tagged;
-		flags = IRQF_SHARED | IRQF_SAMPLE_RANDOM;
+		flags = IRQF_SHARED;
 	}
 
 	return request_irq(tnapi->irq_vec, fn, flags, name, tnapi);
maintainer
#3 lore raw

Re: [PATCH 2/3] tg3: Don't use IRQF_SAMPLE_RANDOM

In reply to Dan Carpenter

From: Dan Carpenter <[email protected]>
Date: Sun, 27 Mar 2011 06:08:30 +0300

Quoted 8 lines · Javier Martinez Canillas
Quoted 7 lines

This flag is scheduled for removal so we shouldn't used it.

---
 drivers/net/tg3.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
Quoted 12 lines

drivers/net/tg3.c static int tg3_request_irq(struct tg3 *tp, int irq_num) · line 8847

Quoted 9 lines
drivers/net/tg3.c +0 -1
index c67eb19..58c6049 100644
@@ -8844,12 +8844,11 @@ static int tg3_request_irq(struct tg3 *tp, int irq_num)
 		fn = tg3_msi;
 		if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)
 			fn = tg3_msi_1shot;
-		flags = IRQF_SAMPLE_RANDOM;

You need initialize flags to zero here. Apparently gcc doesn't catch this. I'm using gcc 4.4.3-4ubuntu5.

Javier please fix this up and resubmit your patch.

Thanks.