blob: 290dc6f4fa950f31acae278501e5fbe2a5245153 [file] [log] [blame]
From d58f0edde79809384658d35ae052517a22486b08 Mon Sep 17 00:00:00 2001
From: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Date: Mon, 26 Dec 2016 11:31:39 -0200
Subject: [PATCH 110/255] [media] v4l: rcar_fdp1: use %4.4s to format a 4-byte
string
Using %4s to format f->fmt.pix_mp.pixelformat in fdp1_try_fmt() and
fdp1_s_fmt() may lead to more characters being printed (when the byte
following field pixelformat is not zero).
Add ".4" to the format specifier to limit the number of printed
characters to four. The resulting format specifier "%4.4s" is also used
by other media drivers to print pixelformat value.
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Reviewed-by: Kieran Bingham <kieran@bingham.xyz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 4c171636bc2beca81b25b07fbe4ac2a6ab27f982)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
drivers/media/platform/rcar_fdp1.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/media/platform/rcar_fdp1.c
+++ b/drivers/media/platform/rcar_fdp1.c
@@ -1596,7 +1596,7 @@ static int fdp1_try_fmt(struct file *fil
else
fdp1_try_fmt_capture(ctx, NULL, &f->fmt.pix_mp);
- dprintk(ctx->fdp1, "Try %s format: %4s (0x%08x) %ux%u field %u\n",
+ dprintk(ctx->fdp1, "Try %s format: %4.4s (0x%08x) %ux%u field %u\n",
V4L2_TYPE_IS_OUTPUT(f->type) ? "output" : "capture",
(char *)&f->fmt.pix_mp.pixelformat, f->fmt.pix_mp.pixelformat,
f->fmt.pix_mp.width, f->fmt.pix_mp.height, f->fmt.pix_mp.field);
@@ -1671,7 +1671,7 @@ static int fdp1_s_fmt(struct file *file,
fdp1_set_format(ctx, &f->fmt.pix_mp, f->type);
- dprintk(ctx->fdp1, "Set %s format: %4s (0x%08x) %ux%u field %u\n",
+ dprintk(ctx->fdp1, "Set %s format: %4.4s (0x%08x) %ux%u field %u\n",
V4L2_TYPE_IS_OUTPUT(f->type) ? "output" : "capture",
(char *)&f->fmt.pix_mp.pixelformat, f->fmt.pix_mp.pixelformat,
f->fmt.pix_mp.width, f->fmt.pix_mp.height, f->fmt.pix_mp.field);