From 747d2305029ab9a47eb01beb9d537b69f5a51a94 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Thu, 3 Dec 2020 23:28:16 +0100 Subject: media: ccs: avoid printing an uninitialized variable There is no intialization for the 'reg' variable, so printing it produces undefined behavior as well as a compile-time warning: drivers/media/i2c/ccs/ccs-core.c:314:49: error: variable 'reg' is uninitialized when used here [-Werror,-Wuninitialized] "0x%8.8x %s pixels: %d %s (pixelcode %u)\n", reg, Remove the variable and stop printing it. Fixes: fd9065812c7b ("media: smiapp: Obtain frame descriptor from CCS limits") Signed-off-by: Arnd Bergmann Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/ccs/ccs-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/media/i2c') diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index 4447ca367a84..7a461c0a730d 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -268,7 +268,6 @@ static int ccs_read_frame_fmt(struct ccs_sensor *sensor) u32 pixels; char *which; char *what; - u32 reg; if (fmt_model_type == CCS_FRAME_FORMAT_MODEL_TYPE_2_BYTE) { desc = CCS_LIM_AT(sensor, FRAME_FORMAT_DESCRIPTOR, i); @@ -322,7 +321,7 @@ static int ccs_read_frame_fmt(struct ccs_sensor *sensor) } dev_dbg(&client->dev, - "0x%8.8x %s pixels: %d %s (pixelcode %u)\n", reg, + "%s pixels: %d %s (pixelcode %u)\n", what, pixels, which, pixelcode); if (i < ncol_desc) { -- cgit v1.2.3