All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: Use vsnprintf extensions %pM and %pI4
@ 2017-06-13  3:20 Joe Perches
  0 siblings, 0 replies; only message in thread
From: Joe Perches @ 2017-06-13  3:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: Hans de Goede, Larry Finger, Greg Kroah-Hartman, devel

Convert the uses of MAC_FMT, MAC_ARG and IP_FMT, IP_ARG to the
kernel extensions.

This could eventually be improved with an in-place substitution.

This reduces object code size a bit too.

$ size drivers/staging/rtl8723bs/r8723bs.o*
   text	   data	    bss	    dec	    hex	filename
 672812	  27040	  24232	 724084	  b0c74	drivers/staging/rtl8723bs/r8723bs.o.allyesconfig.new
 676299	  27040	  24232	 727571	  b1a13	drivers/staging/rtl8723bs/r8723bs.o.allyesconfig.old
 430398	  27040	  21528	 478966	  74ef6	drivers/staging/rtl8723bs/r8723bs.o.defconfig.new
 431581	  27040	  21528	 480149	  75395	drivers/staging/rtl8723bs/r8723bs.o.defconfig.old

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/staging/rtl8723bs/include/ieee80211.h     | 8 ++++----
 drivers/staging/rtl8723bs/include/osdep_service.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
index 6dc6dc73d72f..73ce63770c3c 100644
--- a/drivers/staging/rtl8723bs/include/ieee80211.h
+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
@@ -1003,10 +1003,10 @@ enum ieee80211_state {
 
 #define DEFAULT_MAX_SCAN_AGE (15 * HZ)
 #define DEFAULT_FTS 2346
-#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
-#define MAC_ARG(x) ((u8 *)(x))[0], ((u8 *)(x))[1], ((u8 *)(x))[2], ((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5]
-#define IP_FMT "%d.%d.%d.%d"
-#define IP_ARG(x) ((u8 *)(x))[0], ((u8 *)(x))[1], ((u8 *)(x))[2], ((u8 *)(x))[3]
+#define MAC_FMT "%pM"
+#define MAC_ARG(x) (x)
+#define IP_FMT "%pI4"
+#define IP_ARG(x) (x)
 
 extern __inline int is_multicast_mac_addr(const u8 *addr)
 {
diff --git a/drivers/staging/rtl8723bs/include/osdep_service.h b/drivers/staging/rtl8723bs/include/osdep_service.h
index fdeabc1daeca..ac9ffe0e3b84 100644
--- a/drivers/staging/rtl8723bs/include/osdep_service.h
+++ b/drivers/staging/rtl8723bs/include/osdep_service.h
@@ -169,10 +169,10 @@ __inline static u32 _RND8(u32 sz)
 }
 
 #ifndef MAC_FMT
-#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
+#define MAC_FMT "%pM"
 #endif
 #ifndef MAC_ARG
-#define MAC_ARG(x) ((u8 *)(x))[0], ((u8 *)(x))[1], ((u8 *)(x))[2], ((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5]
+#define MAC_ARG(x) (x)
 #endif
 
 
-- 
2.10.0.rc2.1.g053435c

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-13  3:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-13  3:20 [PATCH] staging: rtl8723bs: Use vsnprintf extensions %pM and %pI4 Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.