Skip to contentSkip to conversation

net: pcnet: slight optimization of addr compare

PATCH Superseded Ding Tianhong 4 participants 5 messages Dec 24, 2013 – Dec 25, 2013

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 3/20 net: pcnet: slight optimization of addr compare

Use possibly more efficient ether_addr_equal_unaligned to instead of memcmp.

---
 drivers/net/ethernet/amd/pcnet32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/amd/pcnet32.c +1 -1
index 38492e0..9339ccc 100644
@@ -1668,7 +1668,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
 	for (i = 0; i < ETH_ALEN; i++)
 		promaddr[i] = inb(ioaddr + i);
 
-	if (memcmp(promaddr, dev->dev_addr, ETH_ALEN) ||
+	if (!ether_addr_equal(promaddr, dev->dev_addr) ||
 	    !is_valid_ether_addr(dev->dev_addr)) {
 		if (is_valid_ether_addr(promaddr)) {
 			if (pcnet32_debug & NETIF_MSG_PROBE) {
Signature · 1 line
1.8.0
#1 lore raw
Quoted 2 lines · Ding Tianhong

Use possibly more efficient ether_addr_equal_unaligned to instead of memcmp.

Hi again Ding.

drivers/net/ethernet/amd/pcnet32.c

Quoted 1 line
drivers/net/ethernet/amd/pcnet32.c +0 -0

[]

drivers/net/ethernet/amd/pcnet32.c pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)

Quoted 1 line
drivers/net/ethernet/amd/pcnet32.c +0 -0
@@ -1668,7 +1668,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)

[]

drivers/net/ethernet/amd/pcnet32.c pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) · line 1671

Quoted 2 lines
drivers/net/ethernet/amd/pcnet32.c +1 -1
-	if (memcmp(promaddr, dev->dev_addr, ETH_ALEN) ||
+	if (!ether_addr_equal(promaddr, dev->dev_addr) ||

Can you please make sure the commit message matches the code changes?

This uses ether_addr_equal not ether_addr_equal_unaligned.

Thanks for the work.

#2 lore raw
Quoted 16 lines · Joe Perches
Quoted 2 lines · Ding Tianhong

Use possibly more efficient ether_addr_equal_unaligned to instead of memcmp.

Hi again Ding.

drivers/net/ethernet/amd/pcnet32.c

Quoted 1 line
drivers/net/ethernet/amd/pcnet32.c +0 -0

[]

drivers/net/ethernet/amd/pcnet32.c pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)

Quoted 1 line
drivers/net/ethernet/amd/pcnet32.c +0 -0
@@ -1668,7 +1668,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)

[]

drivers/net/ethernet/amd/pcnet32.c pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) · line 1671

Quoted 2 lines
drivers/net/ethernet/amd/pcnet32.c +1 -1
-	if (memcmp(promaddr, dev->dev_addr, ETH_ALEN) ||
+	if (!ether_addr_equal(promaddr, dev->dev_addr) ||

Can you please make sure the commit message matches the code changes?

Quoted 4 lines

This uses ether_addr_equal not ether_addr_equal_unaligned.

Thanks for the work.

Oh, no, maybe I was dizzy by these patches, I should be more careful, sorry about that, I will resend this one.

Regards
Ding

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#3 lore raw

From: Ding Tianhong <[email protected]>
Date: Tue, 24 Dec 2013 21:47:30 +0800

Quoted 2 lines

Oh, no, maybe I was dizzy by these patches, I should be more careful, sorry about that, I will resend this one.

You must resend the entire patch series when you make any changes.

Thank you.

#4 lore raw
Quoted 11 lines · David Miller

From: Ding Tianhong <[email protected]>
Date: Tue, 24 Dec 2013 21:47:30 +0800

Quoted 2 lines

Oh, no, maybe I was dizzy by these patches, I should be more careful, sorry about that, I will resend this one.

You must resend the entire patch series when you make any changes.

Thank you.

ok