media: omap3isp: fix uninitialized variable use
PATCH 1/1 media: omap3isp: fix uninitialized variable use
A debug printk statement was copied incorrectly into the new csi1 parser code and causes a warning there:
drivers/media/platform/omap3isp/isp.c: In function 'isp_probe':include/linux/dynamic_debug.h:134:3: error: 'i' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Since there is only one lane, the index is never set. This changes the debug print to always print a zero instead, keeping the original format of the message.
--- drivers/media/platform/omap3isp/isp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/omap3isp/isp.c +1 -1
@@ -2092,7 +2092,7 @@ static int isp_fwnode_parse(struct device *dev, struct fwnode_handle *fwnode, buscfg->bus.ccp2.lanecfg.data[0 ].pol = vep.bus.mipi_csi1.lane_polarity[1 ]; -dev_dbg (dev,"data lane %u polarity %u, pos %u\n" , i, +dev_dbg (dev,"data lane 0 polarity %u, pos %u\n" , buscfg->bus.ccp2.lanecfg.data[0 ].pol, buscfg->bus.ccp2.lanecfg.data[0 ].pos);
Signature · 1 line
2.9.0
Hi Arnd,
Thank you for the patch.
Quoted 7 lines · On Wednesday, 23 August 2017 16:30:19 EEST Arnd Bergmann wrote:
A debug printk statement was copied incorrectly into the new csi1 parser code and causes a warning there:
drivers/media/platform/omap3isp/isp.c: In function 'isp_probe':include/linux/dynamic_debug.h:134:3: error: 'i' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Quoted 7 lines
Since there is only one lane, the index is never set. This changes the debug print to always print a zero instead, keeping the original format of the message.
Fixes 9211434bad30 ("media: omap3isp: Parse CSI1 configuration from thedevice tree")
Signed-off-by Arnd Bergmann <[email protected]>
Quoted 17 lines
--- drivers/media/platform/omap3isp/isp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/media/platform/omap3isp/isp.cindex83aea08b832d..30c825bf80d9100644drivers/media/platform/omap3isp/isp.c +0
-0@@ -2092,7 +2092,7 @@ static int isp_fwnode_parse(struct device *dev, struct
fwnode_handle*fwnode, buscfg->bus.ccp2.lanecfg.data[0].pol =drivers/media/platform/omap3isp/isp.c +1
-1vep.bus.mipi_csi1.lane_polarity[1 ]; -dev_dbg (dev,"data lane %u polarity %u, pos %u\n" , i, +dev_dbg (dev,"data lane 0 polarity %u, pos %u\n" , buscfg->bus.ccp2.lanecfg.data[0 ].pol, buscfg->bus.ccp2.lanecfg.data[0 ].pos);
Signature · 3 lines
Regards, Laurent Pinchart
Hi Arnd,
Quoted 21 lines · Arnd Bergmann
A debug printk statement was copied incorrectly into the new csi1 parser code and causes a warning there:
drivers/media/platform/omap3isp/isp.c: In function 'isp_probe':include/linux/dynamic_debug.h:134:3: error: 'i' may be used uninitialized in this function [-Werror=maybe-uninitialized]Since there is only one lane, the index is never set. This changes the debug print to always print a zero instead, keeping the original format of the message.
Fixes 9211434bad30 ("media: omap3isp: Parse CSI1 configuration from the device tree")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/media/platform/omap3isp/isp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/platform/omap3isp/isp.c +0
-0
drivers/media/platform/omap3isp/isp.c static int isp_fwnode_parse(struct device *dev, struct fwnode_handle *fwnode, · line 2098
Quoted 8 lines
drivers/media/platform/omap3isp/isp.c +1
-1@@ -2092,7 +2092,7 @@ static int isp_fwnode_parse(struct device *dev, struct fwnode_handle *fwnode, buscfg->bus.ccp2.lanecfg.data[0 ].pol = vep.bus.mipi_csi1.lane_polarity[1 ]; -dev_dbg (dev,"data lane %u polarity %u, pos %u\n" , i, +dev_dbg (dev,"data lane 0 polarity %u, pos %u\n" , buscfg->bus.ccp2.lanecfg.data[0 ].pol, buscfg->bus.ccp2.lanecfg.data[0 ].pos);
Thanks! I removed "0 "; CCP2 always has a single lane. The patch is now:
drivers/media/platform/omap3isp/isp.c +1 -1
@@ -2092,7 +2092,7 @@ static int isp_fwnode_parse(struct device *dev, struct fwnode_handle *fwnode, buscfg->bus.ccp2.lanecfg.data[0 ].pol = vep.bus.mipi_csi1.lane_polarity[1 ]; -dev_dbg (dev,"data lane %u polarity %u, pos %u\n" , i, +dev_dbg (dev,"data lane polarity %u, pos %u\n" , buscfg->bus.ccp2.lanecfg.data[0 ].pol, buscfg->bus.ccp2.lanecfg.data[0 ].pos);
Signature · 2 lines
Sakari Ailus e-mail: [email protected]
Sebastian Reichel
Reviewed-byHi,
Quoted 38 lines · Sakari Ailus
Quoted 21 lines · Arnd Bergmann
A debug printk statement was copied incorrectly into the new csi1 parser code and causes a warning there:
drivers/media/platform/omap3isp/isp.c: In function 'isp_probe':include/linux/dynamic_debug.h:134:3: error: 'i' may be used uninitialized in this function [-Werror=maybe-uninitialized]Since there is only one lane, the index is never set. This changes the debug print to always print a zero instead, keeping the original format of the message.
Fixes 9211434bad30 ("media: omap3isp: Parse CSI1 configuration from the device tree")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/media/platform/omap3isp/isp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/platform/omap3isp/isp.c +0
-0drivers/media/platform/omap3isp/isp.c static int isp_fwnode_parse(struct device *dev, struct fwnode_handle *fwnode, · line 2098
Quoted 8 lines
drivers/media/platform/omap3isp/isp.c +1
-1@@ -2092,7 +2092,7 @@ static int isp_fwnode_parse(struct device *dev, struct fwnode_handle *fwnode, buscfg->bus.ccp2.lanecfg.data[0 ].pol = vep.bus.mipi_csi1.lane_polarity[1 ]; -dev_dbg (dev,"data lane %u polarity %u, pos %u\n" , i, +dev_dbg (dev,"data lane 0 polarity %u, pos %u\n" , buscfg->bus.ccp2.lanecfg.data[0 ].pol, buscfg->bus.ccp2.lanecfg.data[0 ].pos);Thanks! I removed "0 "; CCP2 always has a single lane. The patch is now:
drivers/media/platform/omap3isp/isp.c +0
-0
drivers/media/platform/omap3isp/isp.c static int isp_fwnode_parse(struct device *dev, struct fwnode_handle *fwnode, · line 2097
Quoted 7 lines
drivers/media/platform/omap3isp/isp.c +1
-1@@ -2092,7 +2092,7 @@ static int isp_fwnode_parse(struct device *dev, struct fwnode_handle *fwnode, buscfg->bus.ccp2.lanecfg.data[0 ].pol = vep.bus.mipi_csi1.lane_polarity[1 ]; -dev_dbg (dev,"data lane %u polarity %u, pos %u\n" , i, +dev_dbg (dev,"data lane polarity %u, pos %u\n" , buscfg->bus.ccp2.lanecfg.data[0 ].pol, buscfg->bus.ccp2.lanecfg.data[0 ].pos);
-- Sebastian