Skip to contentSkip to conversation

net: drop pointless static qualifier in atl2_probe()

PATCH In review Mao Wenan 2 participants 5 messages Feb 19, 2019 – Feb 22, 2019

Subsystems (3)
lore
Share & tools
lore

Mao Wenan

author
#0 lore raw

PATCH 1/1 net: drop pointless static qualifier in atl2_probe()

There is no need to have the 'T *v' variable static since new value always be assigned before use it.

---
 drivers/net/ethernet/atheros/atlx/atl2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/atheros/atlx/atl2.c +1 -3
index bb41becb6609..6bd686b26837 100644
@@ -1335,13 +1335,11 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	struct net_device *netdev;
 	struct atl2_adapter *adapter;
-	static int cards_found;
+	int cards_found = 0;
 	unsigned long mmio_start;
 	int mmio_len;
 	int err;
 
-	cards_found = 0;
-
 	err = pci_enable_device(pdev);
 	if (err)
 		return err;
Signature · 1 line
2.20.1
author
#1 lore raw

PATCH 1/1 net: drop pointless static qualifier in atl2_probe()

There is no need to have the 'T *v' variable static since new value always be assigned before use it.

---
 drivers/net/ethernet/atheros/atlx/atl2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/atheros/atlx/atl2.c +1 -3
index bb41becb6609..6bd686b26837 100644
@@ -1335,13 +1335,11 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	struct net_device *netdev;
 	struct atl2_adapter *adapter;
-	static int cards_found;
+	int cards_found = 0;
 	unsigned long mmio_start;
 	int mmio_len;
 	int err;
 
-	cards_found = 0;
-
 	err = pci_enable_device(pdev);
 	if (err)
 		return err;
Signature · 1 line
2.20.1
#2 lore raw
In reply to Mao Wenan
Quoted 13 lines · Mao Wenan

There is no need to have the 'T *v' variable static since new value always be assigned before use it.

---
 drivers/net/ethernet/atheros/atlx/atl2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/atheros/atlx/atl2.c +0 -0
index bb41becb6609..6bd686b26837 100644

drivers/net/ethernet/atheros/atlx/atl2.c static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · line 1343

Quoted 10 lines
drivers/net/ethernet/atheros/atlx/atl2.c +1 -2
@@ -1335,13 +1335,11 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	struct net_device *netdev;
 	struct atl2_adapter *adapter;
-	static int cards_found;
+	int cards_found = 0;
 	unsigned long mmio_start;
 	int mmio_len;
 	int err;
 
-	cards_found = 0;

You're sending patches too quickly and you're not thinking about what
you're doing. If someone asks you to redo a patch, that should take
over night to accomplish when you take time to think about what you're doing, but you have sent several versions of a patch in the same day.

This one is obviously wrong, but please take some time and slow down before resending.

regards,
dan carpenter

author
#4 lore raw
In reply to Mao Wenan
Quoted 30 lines · Dan Carpenter
Quoted 13 lines · Mao Wenan

There is no need to have the 'T *v' variable static since new value always be assigned before use it.

---
 drivers/net/ethernet/atheros/atlx/atl2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/atheros/atlx/atl2.c +0 -0
index bb41becb6609..6bd686b26837 100644

drivers/net/ethernet/atheros/atlx/atl2.c static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · line 1343

Quoted 10 lines
drivers/net/ethernet/atheros/atlx/atl2.c +1 -2
@@ -1335,13 +1335,11 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	struct net_device *netdev;
 	struct atl2_adapter *adapter;
-	static int cards_found;
+	int cards_found = 0;
 	unsigned long mmio_start;
 	int mmio_len;
 	int err;
 
-	cards_found = 0;

You're sending patches too quickly and you're not thinking about what
you're doing. If someone asks you to redo a patch, that should take
over night to accomplish when you take time to think about what you're doing, but you have sent several versions of a patch in the same day.

Quoted 2 lines

This one is obviously wrong, but please take some time and slow down before resending.

I'm sorry for this, I have checked again, that the fixes will be as below:

drivers/net/ethernet/atheros/atlx/atl2.c +1 -3
index bb41becb6609..31ff1e0d1baa 100644
@@ -1335,13 +1335,11 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
        struct net_device *netdev;
        struct atl2_adapter *adapter;
-       static int cards_found;
+       static int cards_found = 0;
        unsigned long mmio_start;
        int mmio_len;
        int err;
 
-       cards_found = 0;
-
        err = pci_enable_device(pdev);
        if (err)
                return err;
Quoted 8 lines

regards,
dan carpenter

.