提交 be85fefe 编写于 作者: J Joe Perches 提交者: Mauro Carvalho Chehab

[media] tda18271: Use printk extension %pV

Deduplicate printk formats to save ~20KB text.

$ size drivers/media/common/tuners/tda18271*o.*
   text	   data	    bss	    dec	    hex	filename
  10747	     56	   1920	  12723	   31b3	drivers/media/common/tuners/tda18271-common.o.new
  18889	     56	   3112	  22057	   5629	drivers/media/common/tuners/tda18271-common.o.old
  20561	    204	   4264	  25029	   61c5	drivers/media/common/tuners/tda18271-fe.o.new
  31093	    204	   6000	  37297	   91b1	drivers/media/common/tuners/tda18271-fe.o.old
   3681	   6760	    440	  10881	   2a81	drivers/media/common/tuners/tda18271-maps.o.new
   5631	   6760	    680	  13071	   330f	drivers/media/common/tuners/tda18271-maps.o.old
Signed-off-by: NJoe Perches <joe@perches.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 f68baeff
...@@ -676,10 +676,28 @@ int tda18271_calc_rf_cal(struct dvb_frontend *fe, u32 *freq) ...@@ -676,10 +676,28 @@ int tda18271_calc_rf_cal(struct dvb_frontend *fe, u32 *freq)
return ret; return ret;
} }
/* int _tda_printk(struct tda18271_priv *state, const char *level,
* Overrides for Emacs so that we follow Linus's tabbing style. const char *func, const char *fmt, ...)
* --------------------------------------------------------------------------- {
* Local variables: struct va_format vaf;
* c-basic-offset: 8 va_list args;
* End: int rtn;
*/
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
if (state)
rtn = printk("%s%s: [%d-%04x|%c] %pV",
level, func, i2c_adapter_id(state->i2c_props.adap),
state->i2c_props.addr,
(state->role == TDA18271_MASTER) ? 'M' : 'S',
&vaf);
else
rtn = printk("%s%s: %pV", level, func, &vaf);
va_end(args);
return rtn;
}
...@@ -136,29 +136,26 @@ extern int tda18271_debug; ...@@ -136,29 +136,26 @@ extern int tda18271_debug;
#define DBG_ADV 8 #define DBG_ADV 8
#define DBG_CAL 16 #define DBG_CAL 16
#define tda_printk(st, kern, fmt, arg...) do {\ __attribute__((format(printf, 4, 5)))
if (st) { \ int _tda_printk(struct tda18271_priv *state, const char *level,
struct tda18271_priv *state = st; \ const char *func, const char *fmt, ...);
printk(kern "%s: [%d-%04x|%s] " fmt, __func__, \
i2c_adapter_id(state->i2c_props.adap), \ #define tda_printk(st, lvl, fmt, arg...) \
state->i2c_props.addr, \ _tda_printk(st, lvl, __func__, fmt, ##arg)
(state->role == TDA18271_MASTER) \
? "M" : "S", ##arg); \ #define tda_dprintk(st, lvl, fmt, arg...) \
} else \ do { \
printk(kern "%s: " fmt, __func__, ##arg); \ if (tda18271_debug & lvl) \
tda_printk(st, KERN_DEBUG, fmt, ##arg); \
} while (0) } while (0)
#define tda_dprintk(st, lvl, fmt, arg...) do {\ #define tda_info(fmt, arg...) pr_info(fmt, ##arg)
if (tda18271_debug & lvl) \ #define tda_warn(fmt, arg...) tda_printk(priv, KERN_WARNING, fmt, ##arg)
tda_printk(st, KERN_DEBUG, fmt, ##arg); } while (0) #define tda_err(fmt, arg...) tda_printk(priv, KERN_ERR, fmt, ##arg)
#define tda_dbg(fmt, arg...) tda_dprintk(priv, DBG_INFO, fmt, ##arg)
#define tda_info(fmt, arg...) printk(KERN_INFO fmt, ##arg) #define tda_map(fmt, arg...) tda_dprintk(priv, DBG_MAP, fmt, ##arg)
#define tda_warn(fmt, arg...) tda_printk(priv, KERN_WARNING, fmt, ##arg) #define tda_reg(fmt, arg...) tda_dprintk(priv, DBG_REG, fmt, ##arg)
#define tda_err(fmt, arg...) tda_printk(priv, KERN_ERR, fmt, ##arg) #define tda_cal(fmt, arg...) tda_dprintk(priv, DBG_CAL, fmt, ##arg)
#define tda_dbg(fmt, arg...) tda_dprintk(priv, DBG_INFO, fmt, ##arg)
#define tda_map(fmt, arg...) tda_dprintk(priv, DBG_MAP, fmt, ##arg)
#define tda_reg(fmt, arg...) tda_dprintk(priv, DBG_REG, fmt, ##arg)
#define tda_cal(fmt, arg...) tda_dprintk(priv, DBG_CAL, fmt, ##arg)
#define tda_fail(ret) \ #define tda_fail(ret) \
({ \ ({ \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册