Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1432442

Re: [PATCH] rtlwifi: Create _rtl_dbg_trace function to reduce RT_TRACE code size

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH] rtlwifi: Create _rtl_dbg_trace function to reduce RT_TRACE code size
Date 2016-06-28 06:00 +0200
Message-ID <rOSlP-1qN-3@gated-at.bofh.it> (permalink)
References <rO4yJ-31n-1@gated-at.bofh.it> <rOPxD-7Th-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 2016-06-27 at 19:53 -0500, Larry Finger wrote:
> On 06/25/2016 05:46 PM, Joe Perches wrote:
> > 
> > This debugging macro can expand to a lot of code.
> > Make it a function to reduce code size.
> > 
> > (x86-64 defconfig w/ all rtlwifi drivers and allyesconfig)
> > $ size drivers/net/wireless/realtek/rtlwifi/built-in.o*
> >     text	   data	    bss	    dec	    hex	filename
> >   900083	 200499	   1907	1102489	 10d299	drivers/net/wireless/realtek/rtlwifi/built-in.o.defconfig.new
> > 1113597	 200499	   1907	1316003	 1414a3	drivers/net/wireless/realtek/rtlwifi/built-in.o.defconfig.old
> > 1746879	 453503	   8512	2208894	 21b47e	drivers/net/wireless/realtek/rtlwifi/built-in.o.new
> > 2051965	 503311	   8512	2563788	 271ecc	drivers/net/wireless/realtek/rtlwifi/built-in.o.old
> > 
> > Signed-off-by: Joe Perches <joe@perches.com>
> I acked this before; however there is a bug that breaks the build if 
> CONFIG_RTLWIFI_DEBUG is not defined. The rest of the code calls 
> _rtl_dbg_trace(), but that symbol is never defined. The problem can be fixed in 
> debug.c or debug.h.

Confused a bit.  What breaks again?

debug.h:

#ifdef CONFIG_RTLWIFI_DEBUG
[]
__printf(5, 6)
void _rtl_dbg_trace(struct rtl_priv *rtlpriv, int comp, int level,
		    const char *modname, const char *fmt, ...);

#define RT_TRACE(rtlpriv, comp, level, fmt, ...)			\
	_rtl_dbg_trace(rtlpriv, comp, level,				\
		       KBUILD_MODNAME, fmt, ##__VA_ARGS__)
[]
#else
[]
__printf(4, 5)
static inline void RT_TRACE(struct rtl_priv *rtlpriv,
			    int comp, int level,
			    const char *fmt, ...)
{
}
[]
#endif

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] rtlwifi: Create _rtl_dbg_trace function to reduce RT_TRACE code size Joe Perches <joe@perches.com> - 2016-06-26 00:50 +0200
  Re: [PATCH] rtlwifi: Create _rtl_dbg_trace function to reduce  RT_TRACE code size Larry Finger <Larry.Finger@lwfinger.net> - 2016-06-27 02:20 +0200
  Re: [PATCH] rtlwifi: Create _rtl_dbg_trace function to reduce  RT_TRACE code size Larry Finger <Larry.Finger@lwfinger.net> - 2016-06-28 03:00 +0200
    Re: [PATCH] rtlwifi: Create _rtl_dbg_trace function to reduce  RT_TRACE code size Joe Perches <joe@perches.com> - 2016-06-28 06:00 +0200
      Re: [PATCH] rtlwifi: Create _rtl_dbg_trace function to reduce  RT_TRACE code size Larry Finger <Larry.Finger@lwfinger.net> - 2016-06-28 16:30 +0200
  Re: rtlwifi: Create _rtl_dbg_trace function to reduce RT_TRACE code  size Kalle Valo <kvalo@codeaurora.org> - 2016-07-08 12:00 +0200

csiph-web