]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] tuner-core: use %&ph for small buffer dumps
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 12 Oct 2016 11:19:27 +0000 (08:19 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 21 Oct 2016 10:40:35 +0000 (08:40 -0200)
This driver has a printk with a continuation lines for debugging purposes.
 Since commit 563873318d32 ("Merge branch 'printk-cleanups'"), this
won't work anymore. We might be using KERNEL_CONT, but it is better
to just use a single printk line using %*ph for buffer dump.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/v4l2-core/tuner-core.c

index e2613ecb7605661602b195a0c21c296a2911550a..d3a6236b6b021b6c4dfec70237acdcfb53025da9 100644 (file)
@@ -617,14 +617,12 @@ static int tuner_probe(struct i2c_client *client,
 
        if (show_i2c) {
                unsigned char buffer[16];
-               int i, rc;
+               int rc;
 
                memset(buffer, 0, sizeof(buffer));
                rc = i2c_master_recv(client, buffer, sizeof(buffer));
-               tuner_info("I2C RECV = ");
-               for (i = 0; i < rc; i++)
-                       printk(KERN_CONT "%02x ", buffer[i]);
-               printk("\n");
+               if (rc >= 0)
+                       tuner_info("I2C RECV = %*ph\n", rc, buffer);
        }
 
        /* autodetection code based on the i2c addr */