staging: rtl8188eu: use %*ph specifier instead of passing direct values
PATCH 1/1 staging: rtl8188eu: use %*ph specifier instead of passing direct values
The %*ph specifier allows to pass a pointer and length instead of pushing each byte via stack. The patch converts code to use it.
--- drivers/staging/rtl8188eu/hal/usb_halinit.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/rtl8188eu/hal/usb_halinit.c +2 -4
@@ -1096,10 +1096,8 @@ static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo, boolmemcpy (eeprom->mac_addr, &hwinfo[EEPROM_MAC_ADDR_88EU ],ETH_ALEN ); }RT_TRACE (_module_hci_hal_init_c_, _drv_notice_, - ("Hal_EfuseParseMACAddr_8188EU: Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x\n" , - eeprom->mac_addr[0 ], eeprom->mac_addr[1 ], - eeprom->mac_addr[2 ], eeprom->mac_addr[3 ], - eeprom->mac_addr[4 ], eeprom->mac_addr[5 ])); + ("Hal_EfuseParseMACAddr_8188EU: Permanent Address = %6phD\n" , + eeprom->mac_addr)); } static void
Signature · 1 line
1.9.1
Quoted 4 lines · Mike Krinkin
The %*ph specifier allows to pass a pointer and length instead of pushing each byte via stack. The patch converts code to use it.
Signed-off-by Mike Krinkin <[email protected]>
Why not use %pM as long as you are changing this code? It will format the results in a better way.
Larry
Quoted 22 lines
--- drivers/staging/rtl8188eu/hal/usb_halinit.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/staging/rtl8188eu/hal/usb_halinit.c +2
-4@@ -1096,10 +1096,8 @@ static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo, boolmemcpy (eeprom->mac_addr, &hwinfo[EEPROM_MAC_ADDR_88EU ],ETH_ALEN ); }RT_TRACE (_module_hci_hal_init_c_, _drv_notice_, - ("Hal_EfuseParseMACAddr_8188EU: Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x\n" , - eeprom->mac_addr[0 ], eeprom->mac_addr[1 ], - eeprom->mac_addr[2 ], eeprom->mac_addr[3 ], - eeprom->mac_addr[4 ], eeprom->mac_addr[5 ])); + ("Hal_EfuseParseMACAddr_8188EU: Permanent Address = %6phD\n" , + eeprom->mac_addr)); } static void
Quoted 10 lines · Larry Finger
Quoted 4 lines · Mike Krinkin
The %*ph specifier allows to pass a pointer and length instead of pushing each byte via stack. The patch converts code to use it.
Signed-off-by Mike Krinkin <[email protected]>Why not use %pM as long as you are changing this code? It will format the results in a better way.
Larry
I just thought to save original formatting, but of course %pM is better, i'll resend a new version.
Quoted 24 lines
Quoted 23 lines
--- drivers/staging/rtl8188eu/hal/usb_halinit.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/staging/rtl8188eu/hal/usb_halinit.c +2
-4@@ -1096,10 +1096,8 @@ static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo, boolmemcpy (eeprom->mac_addr, &hwinfo[EEPROM_MAC_ADDR_88EU ],ETH_ALEN ); }RT_TRACE (_module_hci_hal_init_c_, _drv_notice_, - ("Hal_EfuseParseMACAddr_8188EU: Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x\n" , - eeprom->mac_addr[0 ], eeprom->mac_addr[1 ], - eeprom->mac_addr[2 ], eeprom->mac_addr[3 ], - eeprom->mac_addr[4 ], eeprom->mac_addr[5 ])); + ("Hal_EfuseParseMACAddr_8188EU: Permanent Address = %6phD\n" , + eeprom->mac_addr)); } static void