* [PATCH 1/5] tg3: use usleep_range not msleep for small sleeps
2011-03-01 17:04 [PATCH 1/5] tg3: use <linux/io.h> and <linux/uaccess.h> instead <asm/io.h> and <asm/uaccess.h> Javier Martinez Canillas
@ 2011-03-01 17:04 ` Javier Martinez Canillas
[not found] ` <20110302.205536.226759949.davem@davemloft.net>
2011-03-01 17:04 ` [PATCH 3/5] tg3: Enclose macro with complex values in parenthesis Javier Martinez Canillas
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Javier Martinez Canillas @ 2011-03-01 17:04 UTC (permalink / raw)
To: kernelnewbies
Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
---
drivers/net/tg3.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 6be4185..3310c7a 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -2410,7 +2410,7 @@ static int tg3_nvram_read_using_eeprom(struct tg3 *tp,
if (tmp & EEPROM_ADDR_COMPLETE)
break;
- msleep(1);
+ usleep_range(1000, 2000);
}
if (!(tmp & EEPROM_ADDR_COMPLETE))
return -EBUSY;
@@ -2688,7 +2688,7 @@ static int tg3_power_down_prepare(struct tg3 *tp)
tg3_read_mem(tp, NIC_SRAM_FW_ASF_STATUS_MBOX, &val);
if (val == ~NIC_SRAM_FIRMWARE_MBOX_MAGIC1)
break;
- msleep(1);
+ usleep_range(1000, 2000);
}
}
if (tp->tg3_flags & TG3_FLAG_WOL_CAP)
@@ -8901,7 +8901,7 @@ static int tg3_test_interrupt(struct tg3 *tp)
break;
}
- msleep(10);
+ usleep_range(10000, 20000);
}
tg3_disable_ints(tp);
@@ -11863,7 +11863,7 @@ static void __devinit tg3_nvram_init(struct tg3 *tp)
(EEPROM_DEFAULT_CLOCK_PERIOD <<
EEPROM_ADDR_CLKPERD_SHIFT)));
- msleep(1);
+ usleep_range(1000, 2000);
/* Enable seeprom accesses. */
tw32_f(GRC_LOCAL_CTRL,
@@ -11956,7 +11956,7 @@ static int tg3_nvram_write_block_using_eeprom(struct tg3 *tp,
if (val & EEPROM_ADDR_COMPLETE)
break;
- msleep(1);
+ usleep_range(1000, 2000);
}
if (!(val & EEPROM_ADDR_COMPLETE)) {
rc = -EBUSY;
@@ -12263,7 +12263,7 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
pci_read_config_word(tp->pdev, tp->pm_cap + PCI_PM_CTRL, &pmcsr);
pmcsr &= ~PCI_PM_CTRL_STATE_MASK;
pci_write_config_word(tp->pdev, tp->pm_cap + PCI_PM_CTRL, pmcsr);
- msleep(1);
+ usleep_range(1000, 2000);
/* Make sure register accesses (indirect or otherwise)
* will function correctly.
--
1.7.2.3
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 3/5] tg3: Enclose macro with complex values in parenthesis
2011-03-01 17:04 [PATCH 1/5] tg3: use <linux/io.h> and <linux/uaccess.h> instead <asm/io.h> and <asm/uaccess.h> Javier Martinez Canillas
2011-03-01 17:04 ` [PATCH 1/5] tg3: use usleep_range not msleep for small sleeps Javier Martinez Canillas
@ 2011-03-01 17:04 ` Javier Martinez Canillas
[not found] ` <20110302.205601.71129255.davem@davemloft.net>
2011-03-01 17:04 ` [PATCH 4/5] tg3: Don't use IRQF_SAMPLE_RANDOM Javier Martinez Canillas
2011-03-01 17:04 ` [PATCH 5/5] tg3: Fix inline keyword usage Javier Martinez Canillas
3 siblings, 1 reply; 7+ messages in thread
From: Javier Martinez Canillas @ 2011-03-01 17:04 UTC (permalink / raw)
To: kernelnewbies
Macros with complex values should be enclosed in parenthesis.
Change accordingly.
Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
---
drivers/net/tg3.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 6dc7a8a..c67eb19 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -513,16 +513,16 @@ static void tg3_write32_mbox_5906(struct tg3 *tp, u32 off, u32 val)
writel(val, tp->regs + off + GRCMBOX_BASE);
}
-#define tw32_mailbox(reg, val) tp->write32_mbox(tp, reg, val)
+#define tw32_mailbox(reg, val) (tp->write32_mbox(tp, reg, val))
#define tw32_mailbox_f(reg, val) tw32_mailbox_flush(tp, (reg), (val))
-#define tw32_rx_mbox(reg, val) tp->write32_rx_mbox(tp, reg, val)
-#define tw32_tx_mbox(reg, val) tp->write32_tx_mbox(tp, reg, val)
-#define tr32_mailbox(reg) tp->read32_mbox(tp, reg)
+#define tw32_rx_mbox(reg, val) (tp->write32_rx_mbox(tp, reg, val))
+#define tw32_tx_mbox(reg, val) (tp->write32_tx_mbox(tp, reg, val))
+#define tr32_mailbox(reg) (tp->read32_mbox(tp, reg))
-#define tw32(reg, val) tp->write32(tp, reg, val)
+#define tw32(reg, val) (tp->write32(tp, reg, val))
#define tw32_f(reg, val) _tw32_flush(tp, (reg), (val), 0)
#define tw32_wait_f(reg, val, us) _tw32_flush(tp, (reg), (val), (us))
-#define tr32(reg) tp->read32(tp, reg)
+#define tr32(reg) (tp->read32(tp, reg))
static void tg3_write_mem(struct tg3 *tp, u32 off, u32 val)
{
--
1.7.2.3
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 4/5] tg3: Don't use IRQF_SAMPLE_RANDOM
2011-03-01 17:04 [PATCH 1/5] tg3: use <linux/io.h> and <linux/uaccess.h> instead <asm/io.h> and <asm/uaccess.h> Javier Martinez Canillas
2011-03-01 17:04 ` [PATCH 1/5] tg3: use usleep_range not msleep for small sleeps Javier Martinez Canillas
2011-03-01 17:04 ` [PATCH 3/5] tg3: Enclose macro with complex values in parenthesis Javier Martinez Canillas
@ 2011-03-01 17:04 ` Javier Martinez Canillas
2011-03-01 17:04 ` [PATCH 5/5] tg3: Fix inline keyword usage Javier Martinez Canillas
3 siblings, 0 replies; 7+ messages in thread
From: Javier Martinez Canillas @ 2011-03-01 17:04 UTC (permalink / raw)
To: kernelnewbies
This flag is scheduled for removal so we shouldn't used it.
Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
---
drivers/net/tg3.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index c67eb19..58c6049 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -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;
--
1.7.2.3
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 5/5] tg3: Fix inline keyword usage
2011-03-01 17:04 [PATCH 1/5] tg3: use <linux/io.h> and <linux/uaccess.h> instead <asm/io.h> and <asm/uaccess.h> Javier Martinez Canillas
` (2 preceding siblings ...)
2011-03-01 17:04 ` [PATCH 4/5] tg3: Don't use IRQF_SAMPLE_RANDOM Javier Martinez Canillas
@ 2011-03-01 17:04 ` Javier Martinez Canillas
3 siblings, 0 replies; 7+ messages in thread
From: Javier Martinez Canillas @ 2011-03-01 17:04 UTC (permalink / raw)
To: kernelnewbies
The correct usage is "static inline void" not "static void inline".
Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
---
drivers/net/tg3.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 58c6049..d7e564d 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -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;
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] 7+ messages in thread