saa7164: use native print_hex_dump() instead of custom one
Subsystems (3)
PATCH 1/11 saa7164: use native print_hex_dump() instead of custom one
--- drivers/media/video/saa7164/saa7164-api.c | 15 ++++++--- drivers/media/video/saa7164/saa7164-core.c | 46 +++------------------------- drivers/media/video/saa7164/saa7164.h | 1 - 3 files changed, 14 insertions(+), 48 deletions(-)
drivers/media/video/saa7164/saa7164-api.c +10 -5
@@ -670,7 +670,8 @@ int saa7164_api_set_dif(struct saa7164_port *port, u8 reg, u8 val)if (ret !=SAA_OK )printk (KERN_ERR "%s() error, ret(2) = 0x%x\n" , __func__, ret);#if 0 -saa7164_dumphex16 (dev, buf,16 ); +print_hex_dump (KERN_INFO ,"" ,DUMP_PREFIX_OFFSET ,16 ,1 , buf,16 , + false);#endif return ret ==SAA_OK ?0 : -EIO ; }
@@ -1352,7 +1353,8 @@ int saa7164_api_enum_subdevs(struct saa7164_dev *dev) }if (saa_debug &DBGLVL_API ) -saa7164_dumphex16 (dev, buf, (buflen/16 )*16 ); +print_hex_dump (KERN_INFO ,"" ,DUMP_PREFIX_OFFSET ,16 ,1 , buf, + buflen & ~15 , false);saa7164_api_dump_subdevs (dev, buf, buflen);
@@ -1403,7 +1405,8 @@ int saa7164_api_i2c_read(struct saa7164_i2c *bus, u8 addr, u32 reglen, u8 *reg,dprintk (DBGLVL_API ,"%s() len = %d bytes\n" , __func__, len);if (saa_debug &DBGLVL_I2C ) -saa7164_dumphex16 (dev, buf,2 *16 ); +print_hex_dump (KERN_INFO ,"" ,DUMP_PREFIX_OFFSET ,16 ,1 , buf, +32 , false); ret =saa7164_cmd_send (bus->dev, unitid,GET_CUR ,EXU_REGISTER_ACCESS_CONTROL , len, &buf);
@@ -1411,7 +1414,8 @@ int saa7164_api_i2c_read(struct saa7164_i2c *bus, u8 addr, u32 reglen, u8 *reg,printk (KERN_ERR "%s() error, ret(2) = 0x%x\n" , __func__, ret); else {if (saa_debug &DBGLVL_I2C ) -saa7164_dumphex16 (dev, buf,sizeof (buf)); +print_hex_dump (KERN_INFO ,"" ,DUMP_PREFIX_OFFSET ,16 ,1 , + buf,sizeof (buf), false);memcpy (data, (buf +2 *sizeof (u32) + reglen), datalen); }
@@ -1471,7 +1475,8 @@ int saa7164_api_i2c_write(struct saa7164_i2c *bus, u8 addr, u32 datalen,memcpy ((buf +2 *sizeof (u32)), data, datalen);if (saa_debug &DBGLVL_I2C ) -saa7164_dumphex16 (dev, buf,sizeof (buf)); +print_hex_dump (KERN_INFO ,"" ,DUMP_PREFIX_OFFSET ,16 ,1 , + buf,sizeof (buf), false); ret =saa7164_cmd_send (bus->dev, unitid,SET_CUR ,EXU_REGISTER_ACCESS_CONTROL , len, &buf);
drivers/media/video/saa7164/saa7164-core.c +4 -42
70 lines not on this page · raw message
drivers/media/video/saa7164/saa7164.h +0 -1
@@ -484,7 +484,6 @@ extern unsigned int vbi_buffers;/* ----------------------------------------------------------- */ /* saa7164-core.c */ void saa7164_dumpregs (struct saa7164_dev *dev,u32 addr); -void saa7164_dumphex16 (struct saa7164_dev *dev,u8 *buf,int len);void saa7164_getfirmwarestatus (struct saa7164_dev *dev);u32 saa7164_getcurrentfirmwareversion (struct saa7164_dev *dev);void saa7164_histogram_update (struct saa7164_histogram *hg,u32 val);
Signature · 1 line
1.7.10.4
PATCH 2/11 dvb: nxt200x: apply levels to the printk()s
--- drivers/media/dvb/frontends/nxt200x.c | 56 ++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 26 deletions(-)
drivers/media/dvb/frontends/nxt200x.c +30 -26
@@ -37,6 +37,8 @@* /usr/lib/hotplug/firmware/ or /lib/firmware/ * (depending on configuration of firmware hotplug). */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#define NXT2002_DEFAULT_FIRMWARE "dvb-fe-nxt2002.fw"#define NXT2004_DEFAULT_FIRMWARE "dvb-fe-nxt2004.fw"#define CRC_CCIT_MASK 0x1021
@@ -62,10 +64,7 @@ struct nxt200x_state { };static int debug; -#define dprintk(args...) \ - do { \ - if (debug) printk(KERN_DEBUG "nxt200x: " args); \ - } while (0) +#define dprintk(args...) do { if (debug) pr_debug(args); } while (0)static int i2c_writebytes (struct nxt200x_state * state,u8 addr,u8 *buf,u8 len) {
@@ -73,7 +72,7 @@ static int i2c_writebytes (struct nxt200x_state* state, u8 addr, u8 *buf, u8 lenstruct i2c_msg msg = { .addr = addr, .flags =0 , .buf = buf, .len = len };if ((err =i2c_transfer (state->i2c, &msg,1 )) !=1 ) { -printk (KERN_WARNING "nxt200x: %s: i2c write error (addr 0x%02x, err == %i)\n" , +pr_warn ("%s: i2c write error (addr 0x%02x, err == %i)\n" , __func__, addr, err);return -EREMOTEIO ; }
@@ -86,7 +85,7 @@ static int i2c_readbytes(struct nxt200x_state *state, u8 addr, u8 *buf, u8 len)struct i2c_msg msg = { .addr = addr, .flags =I2C_M_RD , .buf = buf, .len = len };if ((err =i2c_transfer (state->i2c, &msg,1 )) !=1 ) { -printk (KERN_WARNING "nxt200x: %s: i2c read error (addr 0x%02x, err == %i)\n" , +pr_warn ("%s: i2c read error (addr 0x%02x, err == %i)\n" , __func__, addr, err);return -EREMOTEIO ; }
@@ -104,7 +103,7 @@ static int nxt200x_writebytes (struct nxt200x_state* state, u8 reg,memcpy (&buf2[1 ], buf, len);if ((err =i2c_transfer (state->i2c, &msg,1 )) !=1 ) { -printk (KERN_WARNING "nxt200x: %s: i2c write error (addr 0x%02x, err == %i)\n" , +pr_warn ("%s: i2c write error (addr 0x%02x, err == %i)\n" , __func__, state->config->demod_address, err);return -EREMOTEIO ; }
@@ -121,7 +120,7 @@ static int nxt200x_readbytes(struct nxt200x_state *state, u8 reg, u8 *buf, u8 leint err;if ((err =i2c_transfer (state->i2c, msg,2 )) !=2 ) { -printk (KERN_WARNING "nxt200x: %s: i2c read error (addr 0x%02x, err == %i)\n" , +pr_warn ("%s: i2c read error (addr 0x%02x, err == %i)\n" , __func__, state->config->demod_address, err);return -EREMOTEIO ; }
@@ -199,7 +198,7 @@ static int nxt200x_writereg_multibyte (struct nxt200x_state* state, u8 reg, u8*break ; } -printk (KERN_WARNING "nxt200x: Error writing multireg register 0x%02X\n" ,reg); +pr_warn ("Error writing multireg register 0x%02X\n" , reg);return 0 ; }
@@ -281,7 +280,8 @@ static void nxt200x_microcontroller_stop (struct nxt200x_state* state) counter++; } -printk (KERN_WARNING "nxt200x: Timeout waiting for nxt200x to stop. This is ok after firmware upload.\n" ); +pr_warn ("Timeout waiting for nxt200x to stop. This is ok after " +"firmware upload.\n" );return ; }
@@ -320,7 +320,7 @@ static void nxt2004_microcontroller_init (struct nxt200x_state* state) counter++; } -printk (KERN_WARNING "nxt200x: Timeout waiting for nxt2004 to init.\n" ); +pr_warn ("Timeout waiting for nxt2004 to init.\n" );return ; }
@@ -338,7 +338,7 @@ static int nxt200x_writetuner (struct nxt200x_state* state, u8* data)switch (state->demod_chip) {case NXT2004 :if (i2c_writebytes (state, data[0 ], data+1 ,4 )) -printk (KERN_WARNING "nxt200x: error writing to tuner\n" ); +pr_warn ("error writing to tuner\n" );/* wait until we have a lock */ while (count <20 ) {i2c_readbytes (state, data[0 ], &buf,1 );
@@ -347,7 +347,7 @@ static int nxt200x_writetuner (struct nxt200x_state* state, u8* data)msleep (100 ); count++; } -printk ("nxt2004: timeout waiting for tuner lock\n" ); +pr_warn ("timeout waiting for tuner lock\n" );break ;case NXT2002 :/* set the i2c transfer speed to the tuner */
@@ -376,7 +376,7 @@ static int nxt200x_writetuner (struct nxt200x_state* state, u8* data)msleep (100 ); count++; } -printk ("nxt2002: timeout error writing tuner\n" ); +pr_warn ("timeout error writing to tuner\n" );break ;default :return -EINVAL ;
@@ -878,22 +878,24 @@ static int nxt2002_init(struct dvb_frontend* fe)u8 buf[2 ];/* request the firmware, this will block until someone uploads it */ -printk ("nxt2002: Waiting for firmware upload (%s)...\n" ,NXT2002_DEFAULT_FIRMWARE ); +pr_debug ("%s: Waiting for firmware upload (%s)...\n" , + __func__,NXT2002_DEFAULT_FIRMWARE ); ret =request_firmware (&fw,NXT2002_DEFAULT_FIRMWARE , state->i2c->dev.parent); -printk ("nxt2002: Waiting for firmware upload(2)...\n" ); +pr_debug ("%s: Waiting for firmware upload(2)...\n" , __func__);if (ret) { -printk ("nxt2002: No firmware uploaded (timeout or file not found?)\n" ); +pr_err ("%s: No firmware uploaded (timeout or file not found?)" +"\n" , __func__);return ret; } ret =nxt2002_load_firmware (fe, fw);release_firmware (fw);if (ret) { -printk ("nxt2002: Writing firmware to device failed\n" ); +pr_err ("%s: Writing firmware to device failed\n" , __func__);return ret; } -printk ("nxt2002: Firmware upload complete\n" ); +pr_info ("%s: Firmware upload complete\n" , __func__);/* Put the micro into reset */ nxt200x_microcontroller_stop (state);
@@ -943,22 +945,24 @@ static int nxt2004_init(struct dvb_frontend* fe)nxt200x_writebytes (state,0x1E , buf,1 );/* request the firmware, this will block until someone uploads it */ -printk ("nxt2004: Waiting for firmware upload (%s)...\n" ,NXT2004_DEFAULT_FIRMWARE ); +pr_debug ("%s: Waiting for firmware upload (%s)...\n" , + __func__,NXT2004_DEFAULT_FIRMWARE ); ret =request_firmware (&fw,NXT2004_DEFAULT_FIRMWARE , state->i2c->dev.parent); -printk ("nxt2004: Waiting for firmware upload(2)...\n" ); +pr_debug ("%s: Waiting for firmware upload(2)...\n" , __func__);if (ret) { -printk ("nxt2004: No firmware uploaded (timeout or file not found?)\n" ); +pr_err ("%s: No firmware uploaded (timeout or file not found?)" +"\n" , __func__);return ret; } ret =nxt2004_load_firmware (fe, fw);release_firmware (fw);if (ret) { -printk ("nxt2004: Writing firmware to device failed\n" ); +pr_err ("%s: Writing firmware to device failed\n" , __func__);return ret; } -printk ("nxt2004: Firmware upload complete\n" ); +pr_info ("%s: Firmware upload complete\n" , __func__);/* ensure transfer is complete */ buf[0 ] =0x01 ;
@@ -1164,11 +1168,11 @@ struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config,switch (buf[0 ]) {case 0x04 : state->demod_chip =NXT2002 ; -printk ("nxt200x: NXT2002 Detected\n" ); +pr_info ("NXT2002 Detected\n" );break ;case 0x05 : state->demod_chip =NXT2004 ; -printk ("nxt200x: NXT2004 Detected\n" ); +pr_info ("NXT2004 Detected\n" );break ;default : goto error;
Signature · 1 line
1.7.10.4
PATCH 3/11 common: tunners: use %*ph to dump small buffers
In reply to Andy Shevchenko--- drivers/media/common/tuners/tuner-xc2028.c | 3 +-- drivers/media/common/tuners/xc4000.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/media/common/tuners/tuner-xc2028.c +1 -2
@@ -1126,8 +1126,7 @@ static int generic_set_freq(struct dvb_frontend *fe, u32 freq /* in HZ */, priv->frequency = freq; -tuner_dbg ("divisor= %02x %02x %02x %02x (freq=%d.%03d)\n" , - buf[0 ], buf[1 ], buf[2 ], buf[3 ], +tuner_dbg ("divisor= %*ph (freq=%d.%03d)\n" ,4 , buf, freq /1000000 , (freq %1000000 ) /1000 ); rc =0 ;
drivers/media/common/tuners/xc4000.c +1 -2
@@ -263,8 +263,7 @@ static int xc_send_i2c_data(struct xc4000_priv *priv, u8 *buf, int len)printk (KERN_ERR "xc4000: I2C write failed (len=%i)\n" , len);if (len ==4 ) { -printk (KERN_ERR "bytes %02x %02x %02x %02x\n" , buf[0 ], - buf[1 ], buf[2 ], buf[3 ]); +printk (KERN_ERR "bytes %*ph\n" ,4 , buf); }return -EREMOTEIO ; }
Signature · 1 line
1.7.10.4
PATCH 4/11 dvb-usb: use %*ph to dump small buffers
In reply to Andy Shevchenko--- drivers/media/dvb/dvb-usb/af9015.c | 3 +-- drivers/media/dvb/dvb-usb/af9035.c | 3 +-- drivers/media/dvb/dvb-usb/pctv452e.c | 7 +++---- 3 files changed, 5 insertions(+), 8 deletions(-)
drivers/media/dvb/dvb-usb/af9015.c +1 -2
@@ -1053,8 +1053,7 @@ static int af9015_rc_query(struct dvb_usb_device *d)/* Only process key if canary killed */ if (buf[16 ] !=0xff && buf[0 ] !=0x01 ) { -deb_rc ("%s: key pressed %02x %02x %02x %02x\n" , __func__, - buf[12 ], buf[13 ], buf[14 ], buf[15 ]); +deb_rc ("%s: key pressed %*ph\n" , __func__,4 , buf +12 );/* Reset the canary */ ret =af9015_write_reg (d,0x98e9 ,0xff );
drivers/media/dvb/dvb-usb/af9035.c +1 -2
@@ -393,8 +393,7 @@ static int af9035_identify_state(struct usb_device *udev,if (ret <0 ) goto err; -pr_debug ("%s: reply=%02x %02x %02x %02x\n" , __func__, - rbuf[0 ], rbuf[1 ], rbuf[2 ], rbuf[3 ]); +pr_debug ("%s: reply=%*ph\n" , __func__,4 , rbuf);if (rbuf[0 ] || rbuf[1 ] || rbuf[2 ] || rbuf[3 ]) *cold =0 ;else
drivers/media/dvb/dvb-usb/pctv452e.c +3 -4
@@ -136,8 +136,8 @@ static int tt3650_ci_msg(struct dvb_usb_device *d, u8 cmd, u8 *data,return 0 ; failed: -err ("CI error %d; %02X %02X %02X -> %02X %02X %02X." , - ret,SYNC_BYTE_OUT , id, cmd, buf[0 ], buf[1 ], buf[2 ]); +err ("CI error %d; %02X %02X %02X -> %*ph." , + ret,SYNC_BYTE_OUT , id, cmd,3 , buf);return ret; }
@@ -556,8 +556,7 @@ static int pctv452e_rc_query(struct dvb_usb_device *d)return ret;if (debug >3 ) { -info ("%s: read: %2d: %02x %02x %02x: " , __func__, - ret, rx[0 ], rx[1 ], rx[2 ]); +info ("%s: read: %2d: %*ph: " , __func__, ret,3 , rx);for (i =0 ; (i < rx[3 ]) && ((i+3 ) <PCTV_ANSWER_LEN ); i++)info (" %02x" , rx[i+3 ]);
Signature · 1 line
1.7.10.4
PATCH 5/11 dvb: frontends: use %*ph to dump small buffers
In reply to Andy Shevchenko--- drivers/media/dvb/frontends/cxd2820r_t.c | 3 +-- drivers/media/dvb/frontends/nxt200x.c | 8 +++----- drivers/media/dvb/frontends/rtl2830.c | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-)
drivers/media/dvb/frontends/cxd2820r_t.c +1 -2
@@ -389,8 +389,7 @@ int cxd2820r_read_status_t(struct dvb_frontend *fe, fe_status_t *status) } } -dbg ("%s: lock=%02x %02x %02x %02x" , __func__, - buf[0 ], buf[1 ], buf[2 ], buf[3 ]); +dbg ("%s: lock=%*ph" , __func__,4 , buf);return ret; error:
drivers/media/dvb/frontends/nxt200x.c +3 -5
@@ -331,7 +331,7 @@ static int nxt200x_writetuner (struct nxt200x_state* state, u8* data)dprintk ("%s\n" , __func__); -dprintk ("Tuner Bytes: %02X %02X %02X %02X\n" , data[1 ], data[2 ], data[3 ], data[4 ]); +dprintk ("Tuner Bytes: %*ph\n" ,4 , data +1 );/* if NXT2004, write directly to tuner. if NXT2002, write through NXT chip. * direct write is required for Philips TUV1236D and ALPS TDHU2 */
@@ -1161,8 +1161,7 @@ struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config,/* read card id */ nxt200x_readbytes (state,0x00 , buf,5 ); -dprintk ("NXT info: %02X %02X %02X %02X %02X\n" , - buf[0 ], buf[1 ], buf[2 ], buf[3 ], buf[4 ]); +dprintk ("NXT info: %*ph\n" ,5 , buf);/* set demod chip */ switch (buf[0 ]) {
@@ -1201,8 +1200,7 @@ struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config, error:kfree (state); -printk ("Unknown/Unsupported NXT chip: %02X %02X %02X %02X %02X\n" , - buf[0 ], buf[1 ], buf[2 ], buf[3 ], buf[4 ]); +pr_err ("Unknown/Unsupported NXT chip: %*ph\n" ,5 , buf);return NULL ; }
drivers/media/dvb/frontends/rtl2830.c +1 -1
@@ -392,7 +392,7 @@ static int rtl2830_get_frontend(struct dvb_frontend *fe)if (ret) goto err; -dbg ("%s: TPS=%02x %02x %02x" , __func__, buf[0 ], buf[1 ], buf[2 ]); +dbg ("%s: TPS=%*ph" , __func__,3 , buf);switch ((buf[0 ] >>2 ) &3 ) {case 0 :
Signature · 1 line
1.7.10.4
PATCH 6/11 radio-shark2: use %*ph to print small buffers
In reply to Andy Shevchenko--- drivers/media/radio/radio-shark2.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
drivers/media/radio/radio-shark2.c +4 -9
@@ -100,12 +100,8 @@ static int shark_write_reg(struct radio_tea5777 *tea, u64 reg)for (i =0 ; i <6 ; i++) shark->transfer_buffer[i +1 ] = (reg >> (40 - i *8 )) &0xff ; -v4l2_dbg (1 , debug, tea->v4l2_dev, -"shark2-write: %02x %02x %02x %02x %02x %02x %02x\n" , - shark->transfer_buffer[0 ], shark->transfer_buffer[1 ], - shark->transfer_buffer[2 ], shark->transfer_buffer[3 ], - shark->transfer_buffer[4 ], shark->transfer_buffer[5 ], - shark->transfer_buffer[6 ]); +v4l2_dbg (1 , debug, tea->v4l2_dev,"shark2-write: %*ph\n" , +7 , shark->transfer_buffer); res = usb_interrupt_msg(shark->usbdev, usb_sndintpipe(shark->usbdev, SHARK_OUT_EP),
@@ -148,9 +144,8 @@ static int shark_read_reg(struct radio_tea5777 *tea, u32 *reg_ret)for (i =0 ; i <3 ; i++) reg |= shark->transfer_buffer[i] << (16 - i *8 ); -v4l2_dbg (1 , debug, tea->v4l2_dev,"shark2-read: %02x %02x %02x\n" , - shark->transfer_buffer[0 ], shark->transfer_buffer[1 ], - shark->transfer_buffer[2 ]); +v4l2_dbg (1 , debug, tea->v4l2_dev,"shark2-read: %*ph\n" , +3 , shark->transfer_buffer); *reg_ret = reg;return 0 ;
Signature · 1 line
1.7.10.4
PATCH 7/11 gspca: use %*ph to print small buffers
In reply to Andy Shevchenko--- drivers/media/video/gspca/sq905c.c | 7 ++----- drivers/media/video/gspca/sq930x.c | 10 +--------- drivers/media/video/gspca/vc032x.c | 7 ++----- 3 files changed, 5 insertions(+), 19 deletions(-)
drivers/media/video/gspca/sq905c.c +2 -5
@@ -228,11 +228,8 @@ static int sd_config(struct gspca_dev *gspca_dev, }/* Note we leave out the usb id and the manufacturing date */ PDEBUG (D_PROBE , -"SQ9050 ID string: %02x - %02x %02x %02x %02x %02x %02x" , - gspca_dev->usb_buf[3 ], - gspca_dev->usb_buf[14 ], gspca_dev->usb_buf[15 ], - gspca_dev->usb_buf[16 ], gspca_dev->usb_buf[17 ], - gspca_dev->usb_buf[18 ], gspca_dev->usb_buf[19 ]); +"SQ9050 ID string: %02x - %*ph" , + gspca_dev->usb_buf[3 ],6 , gspca_dev->usb_buf +14 ); cam->cam_mode = sq905c_mode; cam->nmodes =2 ;
drivers/media/video/gspca/sq930x.c +1 -9
@@ -863,15 +863,7 @@ static int sd_init(struct gspca_dev *gspca_dev)* 6: c8 / c9 / ca / cf = mode webcam?, sensor? webcam? * 7: 00 */ -PDEBUG (D_PROBE ,"info: %02x %02x %02x %02x %02x %02x %02x %02x" , - gspca_dev->usb_buf[0 ], - gspca_dev->usb_buf[1 ], - gspca_dev->usb_buf[2 ], - gspca_dev->usb_buf[3 ], - gspca_dev->usb_buf[4 ], - gspca_dev->usb_buf[5 ], - gspca_dev->usb_buf[6 ], - gspca_dev->usb_buf[7 ]); +PDEBUG (D_PROBE ,"info: %*ph" ,8 , gspca_dev->usb_buf);bridge_init (sd);
drivers/media/video/gspca/vc032x.c +2 -5
@@ -2934,11 +2934,8 @@ static void reg_r(struct gspca_dev *gspca_dev,PDEBUG (D_USBI ,"GET %02x 0001 %04x %02x" , req, index, gspca_dev->usb_buf[0 ]); else - PDEBUG(D_USBI, "GET %02x 0001 %04x %02x %02x %02x", - req, index, - gspca_dev->usb_buf[0 ], - gspca_dev->usb_buf[1 ], - gspca_dev->usb_buf[2]); + PDEBUG(D_USBI, "GET %02x 0001 %04x %*ph", + req, index, 3, gspca_dev->usb_buf);#endif }
Signature · 1 line
1.7.10.4
PATCH 9/11 ati_remote: use %*ph to dump small buffers
In reply to Andy Shevchenko--- drivers/media/rc/ati_remote.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/media/rc/ati_remote.c +3 -8
@@ -331,13 +331,9 @@ static void ati_remote_dump(struct device *dev, unsigned char *data,if (data[0 ] != (unsigned char )0xff && data[0 ] !=0x00 )dev_warn (dev,"Weird byte 0x%02x\n" , data[0 ]); }else if (len ==4 ) -dev_warn (dev,"Weird key %02x %02x %02x %02x\n" , - data[0 ], data[1 ], data[2 ], data[3 ]); +dev_warn (dev,"Weird key %*ph\n" ,4 , data);else -dev_warn (dev, -"Weird data, len=%d %02x %02x %02x %02x %02x %02x ...\n" , - len, data[0 ], data[1 ], data[2 ], data[3 ], data[4 ], - data[5 ]); +dev_warn (dev,"Weird data, len=%d %*ph ...\n" , len,6 , data); }/*
@@ -519,8 +515,7 @@ static void ati_remote_input_report(struct urb *urb)if (data[1 ] != ((data[2 ] + data[3 ] +0xd5 ) &0xff )) {dbginfo (&ati_remote->interface->dev, -"wrong checksum in input: %02x %02x %02x %02x\n" , - data[0 ], data[1 ], data[2 ], data[3 ]); +"wrong checksum in input: %*ph\n" ,4 , data);return ; }
Signature · 1 line
1.7.10.4
PATCH 10/11 saa7127: use %*ph to print small buffers
In reply to Andy Shevchenko--- drivers/media/video/saa7127.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/media/video/saa7127.c +1 -4
@@ -364,10 +364,7 @@ static int saa7127_set_vps(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_ state->vps_data[2 ] = data->data[9 ]; state->vps_data[3 ] = data->data[10 ]; state->vps_data[4 ] = data->data[11 ]; -v4l2_dbg (1 , debug, sd,"Set VPS data %02x %02x %02x %02x %02x\n" , - state->vps_data[0 ], state->vps_data[1 ], - state->vps_data[2 ], state->vps_data[3 ], - state->vps_data[4 ]); +v4l2_dbg (1 , debug, sd,"Set VPS data %*ph\n" ,5 , state->vps_data);saa7127_write (sd,0x55 , state->vps_data[0 ]);saa7127_write (sd,0x56 , state->vps_data[1 ]);saa7127_write (sd,0x57 , state->vps_data[2 ]);
Signature · 1 line
1.7.10.4
PATCH 11/11 au0828: use %*ph to dump small buffers
In reply to Andy Shevchenko--- drivers/media/video/au0828/au0828-core.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/media/video/au0828/au0828-core.c +1 -11
@@ -73,17 +73,7 @@ static void cmd_msg_dump(struct au0828_dev *dev)int i;for (i =0 ; i <sizeof (dev->ctrlmsg); i +=16 ) -dprintk (2 ,"%s() %02x %02x %02x %02x %02x %02x %02x %02x " -"%02x %02x %02x %02x %02x %02x %02x %02x\n" , - __func__, - dev->ctrlmsg[i+0 ], dev->ctrlmsg[i+1 ], - dev->ctrlmsg[i+2 ], dev->ctrlmsg[i+3 ], - dev->ctrlmsg[i+4 ], dev->ctrlmsg[i+5 ], - dev->ctrlmsg[i+6 ], dev->ctrlmsg[i+7 ], - dev->ctrlmsg[i+8 ], dev->ctrlmsg[i+9 ], - dev->ctrlmsg[i+10 ], dev->ctrlmsg[i+11 ], - dev->ctrlmsg[i+12 ], dev->ctrlmsg[i+13 ], - dev->ctrlmsg[i+14 ], dev->ctrlmsg[i+15 ]); +dprintk (2 ,"%s() %*ph\n" , __func__,16 , dev->ctrlmsg + i); } static int send_control_msg(struct au0828_dev *dev, u16 request, u32 value,
Signature · 1 line
1.7.10.4
PATCH 8/11 dvb: use %*ph to hexdump small buffers
In reply to Andy Shevchenko--- drivers/media/dvb/b2c2/flexcop-usb.c | 5 +---- drivers/media/dvb/bt8xx/dst_ca.c | 3 ++- drivers/media/dvb/dvb-core/dmxdev.c | 4 +--- drivers/media/dvb/ngene/ngene-core.c | 14 ++++---------- 4 files changed, 8 insertions(+), 18 deletions(-)
drivers/media/dvb/b2c2/flexcop-usb.c +1 -4
@@ -324,10 +324,7 @@ static void flexcop_usb_process_frame(struct flexcop_usb *fc_usb,flexcop_pass_dmx_packets ( fc_usb->fc_dev, b+2 ,1 ); else - deb_ts( -"not ts packet %02x %02x %02x %02x \n" , - *(b+2 ), *(b+3 ), - *(b+4), *(b+5)); + deb_ts("not ts packet %*ph\n", 4, b+2); b +=190 ; l -=190 ;break ;
drivers/media/dvb/bt8xx/dst_ca.c +2 -1
@@ -321,7 +321,8 @@ static int ca_get_message(struct dst_state *state, struct ca_msg *p_ca_message,return -EFAULT ;if (p_ca_message->msg) { -dprintk (verbose,DST_CA_NOTICE ,1 ," Message = [%02x %02x %02x]" , p_ca_message->msg[0 ], p_ca_message->msg[1 ], p_ca_message->msg[2 ]); +dprintk (verbose,DST_CA_NOTICE ,1 ," Message = [%*ph]" , +3 , p_ca_message->msg);for (i =0 ; i <3 ; i++) { command = command | p_ca_message->msg[i];
drivers/media/dvb/dvb-core/dmxdev.c +1 -3
@@ -370,9 +370,7 @@ static int dvb_dmxdev_section_callback(const u8 *buffer1, size_t buffer1_len,return 0 ; }del_timer (&dmxdevfilter->timer); -dprintk ("dmxdev: section callback %02x %02x %02x %02x %02x %02x\n" , - buffer1[0 ], buffer1[1 ], - buffer1[2 ], buffer1[3 ], buffer1[4 ], buffer1[5 ]); +dprintk ("dmxdev: section callback %*ph\n" ,6 , buffer1); ret =dvb_dmxdev_buffer_write (&dmxdevfilter->buffer, buffer1, buffer1_len);if (ret == buffer1_len) {
drivers/media/dvb/ngene/ngene-core.c +4 -10
@@ -258,22 +258,16 @@ static void dump_command_io(struct ngene *dev)u8 buf[8 ], *b;ngcpyfrom (buf,HOST_TO_NGENE ,8 ); -printk (KERN_ERR "host_to_ngene (%04x): %02x %02x %02x %02x %02x %02x %02x %02x\n" , -HOST_TO_NGENE , buf[0 ], buf[1 ], buf[2 ], buf[3 ], - buf[4 ], buf[5 ], buf[6 ], buf[7 ]); +printk (KERN_ERR "host_to_ngene (%04x): %*ph\n" ,HOST_TO_NGENE ,8 , buf);ngcpyfrom (buf,NGENE_TO_HOST ,8 ); -printk (KERN_ERR "ngene_to_host (%04x): %02x %02x %02x %02x %02x %02x %02x %02x\n" , -NGENE_TO_HOST , buf[0 ], buf[1 ], buf[2 ], buf[3 ], - buf[4 ], buf[5 ], buf[6 ], buf[7 ]); +printk (KERN_ERR "ngene_to_host (%04x): %*ph\n" ,NGENE_TO_HOST ,8 , buf); b = dev->hosttongene; -printk (KERN_ERR "dev->hosttongene (%p): %02x %02x %02x %02x %02x %02x %02x %02x\n" , - b, b[0 ], b[1 ], b[2 ], b[3 ], b[4 ], b[5 ], b[6 ], b[7 ]); +printk (KERN_ERR "dev->hosttongene (%p): %*ph\n" , b,8 , b); b = dev->ngenetohost; -printk (KERN_ERR "dev->ngenetohost (%p): %02x %02x %02x %02x %02x %02x %02x %02x\n" , - b, b[0 ], b[1 ], b[2 ], b[3 ], b[4 ], b[5 ], b[6 ], b[7 ]); +printk (KERN_ERR "dev->ngenetohost (%p): %*ph\n" , b,8 , b); }static int ngene_command_mutex (struct ngene *dev,struct ngene_command *com)
Signature · 1 line
1.7.10.4
Re: [PATCH 05/11] dvb: frontends: use %*ph to dump small buffers
In reply to Andy ShevchenkoQuoted 2 lines · Andy Shevchenko
Signed-off-by Andy Shevchenko <[email protected]>Cc Antti Palosaari <[email protected]>
Nice! I have been looking that kind of solution long time.
Quoted 67 lines
--- drivers/media/dvb/frontends/cxd2820r_t.c | 3 +-- drivers/media/dvb/frontends/nxt200x.c | 8 +++----- drivers/media/dvb/frontends/rtl2830.c | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-)drivers/media/dvb/frontends/cxd2820r_t.c +1
-2@@ -389,8 +389,7 @@ int cxd2820r_read_status_t(struct dvb_frontend *fe, fe_status_t *status) } } -dbg ("%s: lock=%02x %02x %02x %02x" , __func__, - buf[0 ], buf[1 ], buf[2 ], buf[3 ]); +dbg ("%s: lock=%*ph" , __func__,4 , buf);return ret; error:drivers/media/dvb/frontends/nxt200x.c +3
-5@@ -331,7 +331,7 @@ static int nxt200x_writetuner (struct nxt200x_state* state, u8* data)dprintk ("%s\n" , __func__); -dprintk ("Tuner Bytes: %02X %02X %02X %02X\n" , data[1 ], data[2 ], data[3 ], data[4 ]); +dprintk ("Tuner Bytes: %*ph\n" ,4 , data +1 );/* if NXT2004, write directly to tuner. if NXT2002, write through NXT chip. * direct write is required for Philips TUV1236D and ALPS TDHU2 */ @@ -1161,8 +1161,7 @@ struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config,/* read card id */ nxt200x_readbytes (state,0x00 , buf,5 ); -dprintk ("NXT info: %02X %02X %02X %02X %02X\n" , - buf[0 ], buf[1 ], buf[2 ], buf[3 ], buf[4 ]); +dprintk ("NXT info: %*ph\n" ,5 , buf);/* set demod chip */ switch (buf[0 ]) {@@ -1201,8 +1200,7 @@ struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config, error:kfree (state); -printk ("Unknown/Unsupported NXT chip: %02X %02X %02X %02X %02X\n" , - buf[0 ], buf[1 ], buf[2 ], buf[3 ], buf[4 ]); +pr_err ("Unknown/Unsupported NXT chip: %*ph\n" ,5 , buf);return NULL ; }drivers/media/dvb/frontends/rtl2830.c +1
-1@@ -392,7 +392,7 @@ static int rtl2830_get_frontend(struct dvb_frontend *fe)if (ret) goto err; -dbg ("%s: TPS=%02x %02x %02x" , __func__, buf[0 ], buf[1 ], buf[2 ]); +dbg ("%s: TPS=%*ph" , __func__,3 , buf);switch ((buf[0 ] >>2 ) &3 ) {case 0 :
Signature · 1 line
http://palosaari.fi/
Re: [PATCH 04/11] dvb-usb: use %*ph to dump small buffers
In reply to Andy ShevchenkoQuoted 2 lines · Andy Shevchenko
Signed-off-by Andy Shevchenko <[email protected]>Cc Antti Palosaari <[email protected]>
Drop that patch.
af9015 and af9035 were moved to dvb-usb-v2 and due to that it conflicts. I fixed merge conflict, reviewed and tested patch. New version (13678) is here: http://patchwork.linuxtv.org/patch/13678/
And very big thanks Andy, I have been looking that for a while!
https://lkml.org/lkml/2012/7/5/85
regards
Antti
Quoted 60 lines
--- drivers/media/dvb/dvb-usb/af9015.c | 3 +-- drivers/media/dvb/dvb-usb/af9035.c | 3 +-- drivers/media/dvb/dvb-usb/pctv452e.c | 7 +++---- 3 files changed, 5 insertions(+), 8 deletions(-)drivers/media/dvb/dvb-usb/af9015.c +1
-2@@ -1053,8 +1053,7 @@ static int af9015_rc_query(struct dvb_usb_device *d)/* Only process key if canary killed */ if (buf[16 ] !=0xff && buf[0 ] !=0x01 ) { -deb_rc ("%s: key pressed %02x %02x %02x %02x\n" , __func__, - buf[12 ], buf[13 ], buf[14 ], buf[15 ]); +deb_rc ("%s: key pressed %*ph\n" , __func__,4 , buf +12 );/* Reset the canary */ ret =af9015_write_reg (d,0x98e9 ,0xff );drivers/media/dvb/dvb-usb/af9035.c +1
-2@@ -393,8 +393,7 @@ static int af9035_identify_state(struct usb_device *udev,if (ret <0 ) goto err; -pr_debug ("%s: reply=%02x %02x %02x %02x\n" , __func__, - rbuf[0 ], rbuf[1 ], rbuf[2 ], rbuf[3 ]); +pr_debug ("%s: reply=%*ph\n" , __func__,4 , rbuf);if (rbuf[0 ] || rbuf[1 ] || rbuf[2 ] || rbuf[3 ]) *cold =0 ;else drivers/media/dvb/dvb-usb/pctv452e.c +3
-4@@ -136,8 +136,8 @@ static int tt3650_ci_msg(struct dvb_usb_device *d, u8 cmd, u8 *data,return 0 ; failed: -err ("CI error %d; %02X %02X %02X -> %02X %02X %02X." , - ret,SYNC_BYTE_OUT , id, cmd, buf[0 ], buf[1 ], buf[2 ]); +err ("CI error %d; %02X %02X %02X -> %*ph." , + ret,SYNC_BYTE_OUT , id, cmd,3 , buf);return ret; }@@ -556,8 +556,7 @@ static int pctv452e_rc_query(struct dvb_usb_device *d)return ret;if (debug >3 ) { -info ("%s: read: %2d: %02x %02x %02x: " , __func__, - ret, rx[0 ], rx[1 ], rx[2 ]); +info ("%s: read: %2d: %*ph: " , __func__, ret,3 , rx);for (i =0 ; (i < rx[3 ]) && ((i+3 ) <PCTV_ANSWER_LEN ); i++)info (" %02x" , rx[i+3 ]);
Signature · 1 line
http://palosaari.fi/
Re: [PATCH 11/11] au0828: use %*ph to dump small buffers
In reply to Andy ShevchenkoEm 07-08-2012 13:43, Andy Shevchenko escreveu:
Quoted 19 lines
Signed-off-by Andy Shevchenko <[email protected]>--- drivers/media/video/au0828/au0828-core.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)drivers/media/video/au0828/au0828-core.c +0
-5@@ -73,17 +73,7 @@ static void cmd_msg_dump(struct au0828_dev *dev)int i;for (i =0 ; i <sizeof (dev->ctrlmsg); i +=16 ) - dprintk(2, "%s() %02x %02x %02x %02x %02x %02x %02x %02x " - "%02x %02x %02x %02x %02x %02x %02x %02x\n", - __func__, - dev->ctrlmsg[i+0], dev->ctrlmsg[i+1], - dev->ctrlmsg[i+2], dev->ctrlmsg[i+3],
drivers/media/video/au0828/au0828-core.c static void cmd_msg_dump(struct au0828_dev *dev) · line 79
Quoted 10 lines
drivers/media/video/au0828/au0828-core.c +1
-6- dev->ctrlmsg[i+4 ], dev->ctrlmsg[i+5 ], - dev->ctrlmsg[i+6 ], dev->ctrlmsg[i+7 ], - dev->ctrlmsg[i+8 ], dev->ctrlmsg[i+9 ], - dev->ctrlmsg[i+10 ], dev->ctrlmsg[i+11 ], - dev->ctrlmsg[i+12 ], dev->ctrlmsg[i+13 ], - dev->ctrlmsg[i+14], dev->ctrlmsg[i+15]); +dprintk (2 ,"%s() %*ph\n" , __func__,16 , dev->ctrlmsg + i); } static int send_control_msg(struct au0828_dev *dev, u16 request, u32 value,
That one doesn't apply anymore.
Thanks,
Mauro
Re: [PATCH 11/11] au0828: use %*ph to dump small buffers
Quoted 4 lines · Mauro Carvalho Chehab
Em 07-08-2012 13:43, Andy Shevchenko escreveu:
Quoted 2 lines
Signed-off-by Andy Shevchenko <[email protected]>---
That one doesn't apply anymore.
It's not needed anymore. Please, skip it.
Signature · 2 lines
With Best Regards, Andy Shevchenko