diff options
author | Jan Nikitenko <jan.nikitenko@gmail.com> | 2009-07-28 00:05:19 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-12 17:18:13 +0200 |
commit | 43f8de7ac6d504dea159d7842724857e9e020964 (patch) | |
tree | 2573ec170d00e6075c783ec85da0f5293fc4bd65 /drivers/media/dvb | |
parent | V4L/DVB (12336): ivtv: Fix improper GPIO audio mux input switch on video stan... (diff) | |
download | linux-43f8de7ac6d504dea159d7842724857e9e020964.tar.xz linux-43f8de7ac6d504dea159d7842724857e9e020964.zip |
V4L/DVB (12342): af9015: avoid magically sized temporary buffer in eeprom_dump
Replace printing to magically sized temporary buffer with use
of KERN_CONT for continual printing of eeprom registers dump.
Since deb_info is defined as dprintk, which is conditionally defined
to printk without additional parameters, meaning that deb_info is equivalent
to direct printk (without adding KERN_ facility), we can use KERN_DEBUG and
KERN_CONT in there, eliminating the need for sprintf into temporary buffer
with not easily readable/magical size.
Though it's strange, that deb_info definition uses printk without KERN_
facility and callers don't use it either.
Signed-off-by: Jan Nikitenko <jan.nikitenko@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-usb/af9015.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c index 26690dfb3260..00fbaf56c61b 100644 --- a/drivers/media/dvb/dvb-usb/af9015.c +++ b/drivers/media/dvb/dvb-usb/af9015.c @@ -538,24 +538,22 @@ exit: /* dump eeprom */ static int af9015_eeprom_dump(struct dvb_usb_device *d) { - char buf[4+3*16+1], buf2[4]; u8 reg, val; for (reg = 0; ; reg++) { if (reg % 16 == 0) { if (reg) - deb_info("%s\n", buf); - sprintf(buf, "%02x: ", reg); + deb_info(KERN_CONT "\n"); + deb_info(KERN_DEBUG "%02x:", reg); } if (af9015_read_reg_i2c(d, AF9015_I2C_EEPROM, reg, &val) == 0) - sprintf(buf2, "%02x ", val); + deb_info(KERN_CONT " %02x", val); else - strcpy(buf2, "-- "); - strcat(buf, buf2); + deb_info(KERN_CONT " --"); if (reg == 0xff) break; } - deb_info("%s\n", buf); + deb_info(KERN_CONT "\n"); return 0; } |