Thread (5 messages) flat view 5 messages, 2 authors, 2011-08-29

Re: [PATCH 2/2] ath: Make ath_printk void not int and remove unused struct ath_common *

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 18:31:46
Also in: lkml, netdev

On Mon, 2011-08-29 at 14:12 -0400, John W. Linville wrote:
On Fri, Aug 26, 2011 at 01:56:39AM -0700, Joe Perches wrote:
quoted
Changing the return type and removing the unused argument from
ath_printk reduces code size.
Add an __always_unused struct ath_common * to the macros
that call ath_printk to avoid unused variable warnings.
$ size drivers/net/wireless/ath/built-in.o*
   text	   data	    bss	    dec	    hex	filename
1159859	  16235	 212000	1388094	 152e3e	drivers/net/wireless/ath/built-in.o.new
1164175	  16235	 212032	1392442	 153f3a	drivers/net/wireless/ath/built-in.o.old
[]
quoted
+#define _ath_printk(level, common, fmt, ...)			\
+do {								\
+	__always_unused struct ath_common *unused = common;	\
+	ath_printk(level, fmt, ##__VA_ARGS__);			\
+} while (0)
[]
quoted
 #define ath_emerg(common, fmt, ...)				\
-	ath_printk(KERN_EMERG, common, fmt, ##__VA_ARGS__)
+	_ath_printk(KERN_EMERG, common, fmt, ##__VA_ARGS__)
[]
Any reason to preserve all these "common" args?
ath_dbg uses common, the other ath_<level>s do not.

So, other than to avoid modifying all the current uses?
Maybe just consistency or a future use case.

Or not.

I think using the macro to avoid larger line changes is
an acceptable minimal change.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help