public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: omap3isp: fix uninitialized variable use
@ 2017-08-23 13:30 Arnd Bergmann
  2017-08-23 13:55 ` Laurent Pinchart
  2017-08-23 13:58 ` Sakari Ailus
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2017-08-23 13:30 UTC (permalink / raw)
  To: Laurent Pinchart, Mauro Carvalho Chehab
  Cc: Arnd Bergmann, Sakari Ailus, Pavel Machek, Sebastian Reichel,
	linux-media, linux-kernel

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 <arnd@arndb.de>
---
 drivers/media/platform/omap3isp/isp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 83aea08b832d..30c825bf80d9 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -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);
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: omap3isp: fix uninitialized variable use
  2017-08-23 13:30 [PATCH] media: omap3isp: fix uninitialized variable use Arnd Bergmann
@ 2017-08-23 13:55 ` Laurent Pinchart
  2017-08-23 13:58 ` Sakari Ailus
  1 sibling, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2017-08-23 13:55 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mauro Carvalho Chehab, Sakari Ailus, Pavel Machek,
	Sebastian Reichel, linux-media, linux-kernel

Hi Arnd,

Thank you for the patch.

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]
> 
> 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 <arnd@arndb.de>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/platform/omap3isp/isp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/omap3isp/isp.c
> b/drivers/media/platform/omap3isp/isp.c index 83aea08b832d..30c825bf80d9
> 100644
> --- a/drivers/media/platform/omap3isp/isp.c
> +++ b/drivers/media/platform/omap3isp/isp.c
> @@ -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);


-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: omap3isp: fix uninitialized variable use
  2017-08-23 13:30 [PATCH] media: omap3isp: fix uninitialized variable use Arnd Bergmann
  2017-08-23 13:55 ` Laurent Pinchart
@ 2017-08-23 13:58 ` Sakari Ailus
  2017-08-23 15:35   ` Sebastian Reichel
  1 sibling, 1 reply; 4+ messages in thread
From: Sakari Ailus @ 2017-08-23 13:58 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Laurent Pinchart, Mauro Carvalho Chehab, Sakari Ailus,
	Pavel Machek, Sebastian Reichel, linux-media, linux-kernel

Hi Arnd,

On Wed, Aug 23, 2017 at 03:30:19PM +0200, 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]
> 
> 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 <arnd@arndb.de>
> ---
>  drivers/media/platform/omap3isp/isp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
> index 83aea08b832d..30c825bf80d9 100644
> --- a/drivers/media/platform/omap3isp/isp.c
> +++ b/drivers/media/platform/omap3isp/isp.c
> @@ -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:

diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 83aea08b832d..1a428fe9f070 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -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);
 

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: omap3isp: fix uninitialized variable use
  2017-08-23 13:58 ` Sakari Ailus
@ 2017-08-23 15:35   ` Sebastian Reichel
  0 siblings, 0 replies; 4+ messages in thread
From: Sebastian Reichel @ 2017-08-23 15:35 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Arnd Bergmann, Laurent Pinchart, Mauro Carvalho Chehab,
	Sakari Ailus, Pavel Machek, linux-media, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2378 bytes --]

Hi,

On Wed, Aug 23, 2017 at 04:58:27PM +0300, Sakari Ailus wrote:
> On Wed, Aug 23, 2017 at 03:30:19PM +0200, 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]
> > 
> > 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 <arnd@arndb.de>
> > ---
> >  drivers/media/platform/omap3isp/isp.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
> > index 83aea08b832d..30c825bf80d9 100644
> > --- a/drivers/media/platform/omap3isp/isp.c
> > +++ b/drivers/media/platform/omap3isp/isp.c
> > @@ -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:
> 
> diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
> index 83aea08b832d..1a428fe9f070 100644
> --- a/drivers/media/platform/omap3isp/isp.c
> +++ b/drivers/media/platform/omap3isp/isp.c
> @@ -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);

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-23 15:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-23 13:30 [PATCH] media: omap3isp: fix uninitialized variable use Arnd Bergmann
2017-08-23 13:55 ` Laurent Pinchart
2017-08-23 13:58 ` Sakari Ailus
2017-08-23 15:35   ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox