Skip to contentSkip to conversation

drivers/net/skfp/skfddi.c: use %pMF to show MAC address

PATCH Applied H Hartley Sweeten 5 participants 6 messages Jan 7, 2010 – Jan 8, 2010

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

PATCH 1/1 drivers/net/skfp/skfddi.c: use %pMF to show MAC address

Use the %pMF kernel extension to display the MAC address.

The address will still be displayed in the FDDI Canonical format.

---

drivers/net/skfp/skfddi.c +3 -16
index db216a7..1f9698c 100644
@@ -435,13 +435,7 @@ static  int skfp_driver_init(struct net_device *dev)
 		goto fail;
 	}
 	read_address(smc, NULL);
-	pr_debug(KERN_INFO "HW-Addr: %02x %02x %02x %02x %02x %02x\n",
-	       smc->hw.fddi_canon_addr.a[0],
-	       smc->hw.fddi_canon_addr.a[1],
-	       smc->hw.fddi_canon_addr.a[2],
-	       smc->hw.fddi_canon_addr.a[3],
-	       smc->hw.fddi_canon_addr.a[4],
-	       smc->hw.fddi_canon_addr.a[5]);
+	pr_debug(KERN_INFO "HW-Addr: %pMF\n", smc->hw.fddi_canon_addr.a);
 	memcpy(dev->dev_addr, smc->hw.fddi_canon_addr.a, 6);
 
 	smt_reset_defaults(smc, 0);
@@ -890,15 +884,8 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
 							  (struct fddi_addr *)dmi->dmi_addr, 
 							  1);
 
-					pr_debug(KERN_INFO "ENABLE MC ADDRESS:");
-					pr_debug(" %02x %02x %02x ",
-					       dmi->dmi_addr[0],
-					       dmi->dmi_addr[1],
-					       dmi->dmi_addr[2]);
-					pr_debug("%02x %02x %02x\n",
-					       dmi->dmi_addr[3],
-					       dmi->dmi_addr[4],
-					       dmi->dmi_addr[5]);
+					pr_debug(KERN_INFO "ENABLE MC ADDRESS: %pMF\n",
+						dmi->dmi_addr);
 					dmi = dmi->next;
 				}	// for
 
#1 lore raw
Quoted 3 lines · H Hartley Sweeten

Use the %pMF kernel extension to display the MAC address.

The address will still be displayed in the FDDI Canonical format.

I'm not sure that it matters, but prior to this patch the address was displayed with octets delimited by spaces, and afterwards its delimited by hyphens. So perhaps the comment should read:

The address will now be displayed in the FDDI Canonical format.

Quoted 47 lines

---

drivers/net/skfp/skfddi.c +3 -17
index db216a7..1f9698c 100644
@@ -435,13 +435,7 @@ static  int skfp_driver_init(struct net_device *dev)
 		goto fail;
 	}
 	read_address(smc, NULL);
-	pr_debug(KERN_INFO "HW-Addr: %02x %02x %02x %02x %02x %02x\n",
-	       smc->hw.fddi_canon_addr.a[0],
-	       smc->hw.fddi_canon_addr.a[1],
-	       smc->hw.fddi_canon_addr.a[2],
-	       smc->hw.fddi_canon_addr.a[3],
-	       smc->hw.fddi_canon_addr.a[4],
-	       smc->hw.fddi_canon_addr.a[5]);
+	pr_debug(KERN_INFO "HW-Addr: %pMF\n", smc->hw.fddi_canon_addr.a);
 	memcpy(dev->dev_addr, smc->hw.fddi_canon_addr.a, 6);
 
 	smt_reset_defaults(smc, 0);
@@ -890,15 +884,8 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
 							  (struct fddi_addr *)dmi->dmi_addr, 
 							  1);
 
-					pr_debug(KERN_INFO "ENABLE MC ADDRESS:");
-					pr_debug(" %02x %02x %02x ",
-					       dmi->dmi_addr[0],
-					       dmi->dmi_addr[1],
-					       dmi->dmi_addr[2]);
-					pr_debug("%02x %02x %02x\n",
-					       dmi->dmi_addr[3],
-					       dmi->dmi_addr[4],
-					       dmi->dmi_addr[5]);
+					pr_debug(KERN_INFO "ENABLE MC ADDRESS: %pMF\n",
+						dmi->dmi_addr);
 					dmi = dmi->next;
 				}	// for
 
--

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

#2 lore raw
Quoted 10 lines · Simon Horman
Quoted 2 lines · H Hartley Sweeten

Use the %pMF kernel extension to display the MAC address. The address will still be displayed in the FDDI Canonical format.

I'm not sure that it matters, but prior to this patch the address was displayed with octets delimited by spaces, and afterwards its delimited by hyphens. So perhaps the comment should read:

The address will now be displayed in the FDDI Canonical format.

And it probably wasn't bit reversed.

Quoted 8 lines
Quoted 8 lines
drivers/net/skfp/skfddi.c +0 -0
index db216a7..1f9698c 100644
@@ -435,13 +435,7 @@ static  int skfp_driver_init(struct net_device *dev)
 		goto fail;
 	}
 	read_address(smc, NULL);
Quoted 8 lines

drivers/net/skfp/skfddi.c static int skfp_driver_init(struct net_device *dev) · line 438

Quoted 8 lines
drivers/net/skfp/skfddi.c +1 -7
-	pr_debug(KERN_INFO "HW-Addr: %02x %02x %02x %02x %02x %02x\n",
-	       smc->hw.fddi_canon_addr.a[0],
-	       smc->hw.fddi_canon_addr.a[1],
-	       smc->hw.fddi_canon_addr.a[2],
-	       smc->hw.fddi_canon_addr.a[3],
-	       smc->hw.fddi_canon_addr.a[4],
-	       smc->hw.fddi_canon_addr.a[5]);
+	pr_debug(KERN_INFO "HW-Addr: %pMF\n", smc->hw.fddi_canon_addr.a);

Is fddi_canon_addr already bit reversed?
It's memcpy'd to dev->dev_addr later, so probably not.

Quoted 5 lines
Quoted 5 lines
drivers/net/skfp/skfddi.c +0 -0
 	smt_reset_defaults(smc, 0);
@@ -890,15 +884,8 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
 							  (struct fddi_addr *)dmi->dmi_addr, 
 							  1);
 
Quoted 11 lines

drivers/net/skfp/skfddi.c static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev) · line 888

Quoted 11 lines
drivers/net/skfp/skfddi.c +2 -9
-					pr_debug(KERN_INFO "ENABLE MC ADDRESS:");
-					pr_debug(" %02x %02x %02x ",
-					       dmi->dmi_addr[0],
-					       dmi->dmi_addr[1],
-					       dmi->dmi_addr[2]);
-					pr_debug("%02x %02x %02x\n",
-					       dmi->dmi_addr[3],
-					       dmi->dmi_addr[4],
-					       dmi->dmi_addr[5]);
+					pr_debug(KERN_INFO "ENABLE MC ADDRESS: %pMF\n",
+						dmi->dmi_addr);

I think you want %pM here, not the bit-reversed %pMF form.

#3 lore raw
Quoted 39 lines · Joe Perches
Quoted 10 lines · Simon Horman
Quoted 2 lines · H Hartley Sweeten

Use the %pMF kernel extension to display the MAC address. The address will still be displayed in the FDDI Canonical format.

I'm not sure that it matters, but prior to this patch the address was displayed with octets delimited by spaces, and afterwards its delimited by hyphens. So perhaps the comment should read:

The address will now be displayed in the FDDI Canonical format.

And it probably wasn't bit reversed.

Quoted 8 lines
Quoted 8 lines
drivers/net/skfp/skfddi.c +0 -0
index db216a7..1f9698c 100644
@@ -435,13 +435,7 @@ static  int skfp_driver_init(struct net_device *dev)
 		goto fail;
 	}
 	read_address(smc, NULL);
Quoted 8 lines

drivers/net/skfp/skfddi.c static int skfp_driver_init(struct net_device *dev) · line 438

Quoted 8 lines
drivers/net/skfp/skfddi.c +1 -7
-	pr_debug(KERN_INFO "HW-Addr: %02x %02x %02x %02x %02x %02x\n",
-	       smc->hw.fddi_canon_addr.a[0],
-	       smc->hw.fddi_canon_addr.a[1],
-	       smc->hw.fddi_canon_addr.a[2],
-	       smc->hw.fddi_canon_addr.a[3],
-	       smc->hw.fddi_canon_addr.a[4],
-	       smc->hw.fddi_canon_addr.a[5]);
+	pr_debug(KERN_INFO "HW-Addr: %pMF\n", smc->hw.fddi_canon_addr.a);

Is fddi_canon_addr already bit reversed?
It's memcpy'd to dev->dev_addr later, so probably not.

Quoted 5 lines
Quoted 5 lines
drivers/net/skfp/skfddi.c +0 -0
 	smt_reset_defaults(smc, 0);
@@ -890,15 +884,8 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
 							  (struct fddi_addr *)dmi->dmi_addr, 
 							  1);
 
Quoted 14 lines
Quoted 11 lines

drivers/net/skfp/skfddi.c static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev) · line 888

Quoted 11 lines
drivers/net/skfp/skfddi.c +2 -9
-					pr_debug(KERN_INFO "ENABLE MC ADDRESS:");
-					pr_debug(" %02x %02x %02x ",
-					       dmi->dmi_addr[0],
-					       dmi->dmi_addr[1],
-					       dmi->dmi_addr[2]);
-					pr_debug("%02x %02x %02x\n",
-					       dmi->dmi_addr[3],
-					       dmi->dmi_addr[4],
-					       dmi->dmi_addr[5]);
+					pr_debug(KERN_INFO "ENABLE MC ADDRESS: %pMF\n",
+						dmi->dmi_addr);

I think you want %pM here, not the bit-reversed %pMF form.

Keeping in mind that %pM uses ':' as the delimiter and %pMF uses '-', which by all accounts is not the FDDI canonical format. But then again, neither is the current use of ' ' as the delimiter.

... seems like there is some discussion surrounding the other patch in the series and what the format and bit-order should be.

#4 lore raw
In reply to Joe Perches

2010/1/8 Joe Perches <[email protected]>:

Quoted 35 lines · Simon Horman
Quoted 9 lines · H Hartley Sweeten
Quoted 2 lines

Use the %pMF kernel extension to display the MAC address. The address will still be displayed in the FDDI Canonical format.

I'm not sure that it matters, but prior to this patch the address was displayed with octets delimited by spaces, and afterwards its delimited by hyphens. So perhaps the comment should read:

The address will now be displayed in the FDDI Canonical format.

And it probably wasn't bit reversed.

Quoted 8 lines
Quoted 8 lines
drivers/net/skfp/skfddi.c +0 -0
index db216a7..1f9698c 100644
@@ -435,13 +435,7 @@ static  int skfp_driver_init(struct net_device *dev)
             goto fail;
     }
     read_address(smc, NULL);
Quoted 8 lines

drivers/net/skfp/skfddi.c static int skfp_driver_init(struct net_device *dev) · line 438

Quoted 8 lines
drivers/net/skfp/skfddi.c +1 -7
-   pr_debug(KERN_INFO "HW-Addr: %02x %02x %02x %02x %02x %02x\n",
-          smc->hw.fddi_canon_addr.a[0],
-          smc->hw.fddi_canon_addr.a[1],
-          smc->hw.fddi_canon_addr.a[2],
-          smc->hw.fddi_canon_addr.a[3],
-          smc->hw.fddi_canon_addr.a[4],
-          smc->hw.fddi_canon_addr.a[5]);
+   pr_debug(KERN_INFO "HW-Addr: %pMF\n", smc->hw.fddi_canon_addr.a);

Is fddi_canon_addr already bit reversed?
It's memcpy'd to dev->dev_addr later, so probably not.

Quoted 5 lines
Quoted 5 lines
drivers/net/skfp/skfddi.c +0 -0
     smt_reset_defaults(smc, 0);
@@ -890,15 +884,8 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
                                                       (struct fddi_addr *)dmi->dmi_addr,
                                                       1);
 
Quoted 12 lines
Quoted 11 lines

drivers/net/skfp/skfddi.c static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev) · line 888

Quoted 11 lines
drivers/net/skfp/skfddi.c +2 -9
-                                   pr_debug(KERN_INFO "ENABLE MC ADDRESS:");
-                                   pr_debug(" %02x %02x %02x ",
-                                          dmi->dmi_addr[0],
-                                          dmi->dmi_addr[1],
-                                          dmi->dmi_addr[2]);
-                                   pr_debug("%02x %02x %02x\n",
-                                          dmi->dmi_addr[3],
-                                          dmi->dmi_addr[4],
-                                          dmi->dmi_addr[5]);
+                                   pr_debug(KERN_INFO "ENABLE MC ADDRESS: %pMF\n",
+                                           dmi->dmi_addr);

I think you want %pM here, not the bit-reversed %pMF form.

You could add %pMf for those, that are bit-reversed already? That should take at most two extra insns for x86. ;)

Best Regards,
Michał Mirosław