diff options
author | Joe Perches <joe@perches.com> | 2011-07-31 01:37:10 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-08-27 11:19:43 -0300 |
commit | be85fefecb20b533a2c3f668a345f03f492aeea3 (patch) | |
tree | 0d6acdf6a77ada0c902eed78f4df3d1248b760d3 /drivers/media/common/tuners/tda18271-common.c | |
parent | f68baeff4530593777295f9b94600b4960eddecd (diff) |
[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: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/tuners/tda18271-common.c')
-rw-r--r-- | drivers/media/common/tuners/tda18271-common.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/drivers/media/common/tuners/tda18271-common.c b/drivers/media/common/tuners/tda18271-common.c index aae40e52af5..39c645787b6 100644 --- a/drivers/media/common/tuners/tda18271-common.c +++ b/drivers/media/common/tuners/tda18271-common.c @@ -676,10 +676,28 @@ fail: return ret; } -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * --------------------------------------------------------------------------- - * Local variables: - * c-basic-offset: 8 - * End: - */ +int _tda_printk(struct tda18271_priv *state, const char *level, + const char *func, const char *fmt, ...) +{ + struct va_format vaf; + va_list args; + 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; +} |