2015-09-03 08:06:31

by Alexander Kuleshov

[permalink] [raw]
Subject: [PATCH v2] staging/wilc1000: Use %pM format specifier to print mac address

printk() supports %pM format specifier for printing 6-byte MAC/FDDI
addresses in hex notation small buffers, let's use it intead of %x:%x...

Signed-off-by: Alexander Kuleshov <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 6 +++---
drivers/staging/wilc1000/linux_wlan.c | 3 +--
2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 6b10bbb..48ee908 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -854,7 +854,7 @@ static s32 Handle_SetMacAddress(void *drvHandler, tstrHostIfSetMacAddress *pstrH
strWID.enuWIDtype = WID_STR;
strWID.ps8WidVal = mac_buf;
strWID.s32ValueSize = ETH_ALEN;
- PRINT_D(GENERIC_DBG, "mac addr = :%x:%x:%x:%x:%x:%x\n", strWID.ps8WidVal[0], strWID.ps8WidVal[1], strWID.ps8WidVal[2], strWID.ps8WidVal[3], strWID.ps8WidVal[4], strWID.ps8WidVal[5]);
+ PRINT_D(GENERIC_DBG, "mac addr = :%pM\n", strWID.ps8WidVal);
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true, (u32)pstrWFIDrv);
if (s32Error) {
@@ -1965,8 +1965,8 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
if (pstrHostIFconnectAttr->pu8bssid != NULL) {
WILC_memcpy(u8ConnectedSSID, pstrHostIFconnectAttr->pu8bssid, ETH_ALEN);

- PRINT_D(GENERIC_DBG, "save Bssid = %x:%x:%x:%x:%x:%x\n", (pstrHostIFconnectAttr->pu8bssid[0]), (pstrHostIFconnectAttr->pu8bssid[1]), (pstrHostIFconnectAttr->pu8bssid[2]), (pstrHostIFconnectAttr->pu8bssid[3]), (pstrHostIFconnectAttr->pu8bssid[4]), (pstrHostIFconnectAttr->pu8bssid[5]));
- PRINT_D(GENERIC_DBG, "save bssid = %x:%x:%x:%x:%x:%x\n", (u8ConnectedSSID[0]), (u8ConnectedSSID[1]), (u8ConnectedSSID[2]), (u8ConnectedSSID[3]), (u8ConnectedSSID[4]), (u8ConnectedSSID[5]));
+ PRINT_D(GENERIC_DBG, "save Bssid = %pM\n", pstrHostIFconnectAttr->pu8bssid);
+ PRINT_D(GENERIC_DBG, "save bssid = %pM\n", u8ConnectedSSID);
}

s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, false, (u32)pstrWFIDrv);
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index b352c50..b65e0ae 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -2071,8 +2071,7 @@ int mac_open(struct net_device *ndev)
Set_machw_change_vir_if(false);

host_int_get_MacAddress(priv->hWILCWFIDrv, mac_add);
- PRINT_D(INIT_DBG, "Mac address: %x:%x:%x:%x:%x:%x\n", mac_add[0], mac_add[1], mac_add[2],
- mac_add[3], mac_add[4], mac_add[5]);
+ PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add);

/* loop through the NUM of supported devices and set the MAC address */
for (i = 0; i < g_linux_wlan->u8NoIfcs; i++) {
--
2.5.0



2015-09-03 18:36:28

by Alexander Kuleshov

[permalink] [raw]
Subject: [PATCH v2] staging/wilc1000: Use %pM format specifier to print mac address

printk() supports %pM format specifier for printing 6-byte MAC/FDDI
addresses in hex notation small buffers, let's use it intead of %x:%x...

Changelog:

v1 -> v2:

* In the first version of the patch was instruduced incorrect conversion,
now there is previous formatting in the WILC_WFI_mon_xmit().

Signed-off-by: Alexander Kuleshov <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 6 +++---
drivers/staging/wilc1000/linux_wlan.c | 3 +--
2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 6b10bbb..48ee908 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -854,7 +854,7 @@ static s32 Handle_SetMacAddress(void *drvHandler, tstrHostIfSetMacAddress *pstrH
strWID.enuWIDtype = WID_STR;
strWID.ps8WidVal = mac_buf;
strWID.s32ValueSize = ETH_ALEN;
- PRINT_D(GENERIC_DBG, "mac addr = :%x:%x:%x:%x:%x:%x\n", strWID.ps8WidVal[0], strWID.ps8WidVal[1], strWID.ps8WidVal[2], strWID.ps8WidVal[3], strWID.ps8WidVal[4], strWID.ps8WidVal[5]);
+ PRINT_D(GENERIC_DBG, "mac addr = :%pM\n", strWID.ps8WidVal);
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true, (u32)pstrWFIDrv);
if (s32Error) {
@@ -1965,8 +1965,8 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
if (pstrHostIFconnectAttr->pu8bssid != NULL) {
WILC_memcpy(u8ConnectedSSID, pstrHostIFconnectAttr->pu8bssid, ETH_ALEN);

- PRINT_D(GENERIC_DBG, "save Bssid = %x:%x:%x:%x:%x:%x\n", (pstrHostIFconnectAttr->pu8bssid[0]), (pstrHostIFconnectAttr->pu8bssid[1]), (pstrHostIFconnectAttr->pu8bssid[2]), (pstrHostIFconnectAttr->pu8bssid[3]), (pstrHostIFconnectAttr->pu8bssid[4]), (pstrHostIFconnectAttr->pu8bssid[5]));
- PRINT_D(GENERIC_DBG, "save bssid = %x:%x:%x:%x:%x:%x\n", (u8ConnectedSSID[0]), (u8ConnectedSSID[1]), (u8ConnectedSSID[2]), (u8ConnectedSSID[3]), (u8ConnectedSSID[4]), (u8ConnectedSSID[5]));
+ PRINT_D(GENERIC_DBG, "save Bssid = %pM\n", pstrHostIFconnectAttr->pu8bssid);
+ PRINT_D(GENERIC_DBG, "save bssid = %pM\n", u8ConnectedSSID);
}

s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, false, (u32)pstrWFIDrv);
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index b352c50..b65e0ae 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -2071,8 +2071,7 @@ int mac_open(struct net_device *ndev)
Set_machw_change_vir_if(false);

host_int_get_MacAddress(priv->hWILCWFIDrv, mac_add);
- PRINT_D(INIT_DBG, "Mac address: %x:%x:%x:%x:%x:%x\n", mac_add[0], mac_add[1], mac_add[2],
- mac_add[3], mac_add[4], mac_add[5]);
+ PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add);

/* loop through the NUM of supported devices and set the MAC address */
for (i = 0; i < g_linux_wlan->u8NoIfcs; i++) {
--
2.5.0


2015-09-03 14:23:51

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v2] staging/wilc1000: Use %pM format specifier to print mac address

On Thu, Sep 03, 2015 at 02:05:42PM +0600, Alexander Kuleshov wrote:
> printk() supports %pM format specifier for printing 6-byte MAC/FDDI
> addresses in hex notation small buffers, let's use it intead of %x:%x...
>
> Signed-off-by: Alexander Kuleshov <[email protected]>
> ---
> drivers/staging/wilc1000/host_interface.c | 6 +++---
> drivers/staging/wilc1000/linux_wlan.c | 3 +--
> 2 files changed, 4 insertions(+), 5 deletions(-)

What changed from v1 of this patch? Please be specific.

thanks,

greg k-h

2015-09-03 18:41:51

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v2] staging/wilc1000: Use %pM format specifier to print mac address

On Fri, Sep 04, 2015 at 12:35:38AM +0600, Alexander Kuleshov wrote:
> printk() supports %pM format specifier for printing 6-byte MAC/FDDI
> addresses in hex notation small buffers, let's use it intead of %x:%x...
>
> Changelog:
>
> v1 -> v2:
>
> * In the first version of the patch was instruduced incorrect conversion,
> now there is previous formatting in the WILC_WFI_mon_xmit().

changelog doesn't belong here in the body of the text, it should be
below the --- line so it doesn't get committed into git.

thanks,

greg k-h

2015-09-03 18:48:57

by Alexander Kuleshov

[permalink] [raw]
Subject: [PATCH v2] staging/wilc1000: Use %pM format specifier to print mac address

printk() supports %pM format specifier for printing 6-byte MAC/FDDI
addresses in hex notation small buffers, let's use it intead of %x:%x...

Signed-off-by: Alexander Kuleshov <[email protected]>
---
Changelog:

v1 -> v2:

* In the first version of the patch was instruduced incorrect conversion,
now there is previous formatting in the WILC_WFI_mon_xmit().

drivers/staging/wilc1000/host_interface.c | 6 +++---
drivers/staging/wilc1000/linux_wlan.c | 3 +--
2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 6b10bbb..48ee908 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -854,7 +854,7 @@ static s32 Handle_SetMacAddress(void *drvHandler, tstrHostIfSetMacAddress *pstrH
strWID.enuWIDtype = WID_STR;
strWID.ps8WidVal = mac_buf;
strWID.s32ValueSize = ETH_ALEN;
- PRINT_D(GENERIC_DBG, "mac addr = :%x:%x:%x:%x:%x:%x\n", strWID.ps8WidVal[0], strWID.ps8WidVal[1], strWID.ps8WidVal[2], strWID.ps8WidVal[3], strWID.ps8WidVal[4], strWID.ps8WidVal[5]);
+ PRINT_D(GENERIC_DBG, "mac addr = :%pM\n", strWID.ps8WidVal);
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true, (u32)pstrWFIDrv);
if (s32Error) {
@@ -1965,8 +1965,8 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
if (pstrHostIFconnectAttr->pu8bssid != NULL) {
WILC_memcpy(u8ConnectedSSID, pstrHostIFconnectAttr->pu8bssid, ETH_ALEN);

- PRINT_D(GENERIC_DBG, "save Bssid = %x:%x:%x:%x:%x:%x\n", (pstrHostIFconnectAttr->pu8bssid[0]), (pstrHostIFconnectAttr->pu8bssid[1]), (pstrHostIFconnectAttr->pu8bssid[2]), (pstrHostIFconnectAttr->pu8bssid[3]), (pstrHostIFconnectAttr->pu8bssid[4]), (pstrHostIFconnectAttr->pu8bssid[5]));
- PRINT_D(GENERIC_DBG, "save bssid = %x:%x:%x:%x:%x:%x\n", (u8ConnectedSSID[0]), (u8ConnectedSSID[1]), (u8ConnectedSSID[2]), (u8ConnectedSSID[3]), (u8ConnectedSSID[4]), (u8ConnectedSSID[5]));
+ PRINT_D(GENERIC_DBG, "save Bssid = %pM\n", pstrHostIFconnectAttr->pu8bssid);
+ PRINT_D(GENERIC_DBG, "save bssid = %pM\n", u8ConnectedSSID);
}

s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, false, (u32)pstrWFIDrv);
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index b352c50..b65e0ae 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -2071,8 +2071,7 @@ int mac_open(struct net_device *ndev)
Set_machw_change_vir_if(false);

host_int_get_MacAddress(priv->hWILCWFIDrv, mac_add);
- PRINT_D(INIT_DBG, "Mac address: %x:%x:%x:%x:%x:%x\n", mac_add[0], mac_add[1], mac_add[2],
- mac_add[3], mac_add[4], mac_add[5]);
+ PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add);

/* loop through the NUM of supported devices and set the MAC address */
for (i = 0; i < g_linux_wlan->u8NoIfcs; i++) {
--
2.5.0