All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [STABLE-4.13] [media] imx-media-of: avoid uninitialized variable warning
@ 2017-10-04 13:34 Arnd Bergmann
  2017-10-05  9:16 ` Patch "[media] imx-media-of: avoid uninitialized variable warning" has been added to the 4.13-stable tree gregkh
  2017-10-05 12:32 ` [PATCH] [STABLE-4.13] [media] imx-media-of: avoid uninitialized variable warning Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2017-10-04 13:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Arnd Bergmann, stable, Philipp Zabel, Steve Longerbeam,
	Hans Verkuil, Mauro Carvalho Chehab, Steve Longerbeam,
	Mauro Carvalho Chehab, Russell King, linux-media, devel,
	linux-kernel

Replaces upstream commit 0b2e9e7947e7 ("media: staging/imx: remove
confusing IS_ERR_OR_NULL usage")

We get a harmless warning about a potential uninitialized variable
use in the driver:

drivers/staging/media/imx/imx-media-of.c: In function 'of_parse_subdev':
drivers/staging/media/imx/imx-media-of.c:216:4: warning: 'remote_np' may be used uninitialized in this function [-Wmaybe-uninitialized]

I reworked that code to be easier to understand by gcc in mainline,
but that commit is too large to backport. This is a much simpler
workaround, avoiding the warning by adding a fake initialization
to the variable. The driver was only introduced in linux-4.13,
so the workaround is not needed for earlier stable kernels.

Fixes: e130291212df ("[media] media: Add i.MX media core driver")
Cc: stable@vger.kernel.org
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Steve Longerbeam <steve_longerbeam@mentor.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/media/imx/imx-media-of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/imx/imx-media-of.c b/drivers/staging/media/imx/imx-media-of.c
index b026fe66467c..90e7e702a411 100644
--- a/drivers/staging/media/imx/imx-media-of.c
+++ b/drivers/staging/media/imx/imx-media-of.c
@@ -167,7 +167,7 @@ of_parse_subdev(struct imx_media_dev *imxmd, struct device_node *sd_np,
 		of_parse_sensor(imxmd, imxsd, sd_np);
 
 	for (i = 0; i < num_pads; i++) {
-		struct device_node *epnode = NULL, *port, *remote_np;
+		struct device_node *epnode = NULL, *port, *remote_np = NULL;
 		struct imx_media_subdev *remote_imxsd;
 		struct imx_media_pad *pad;
 		int remote_pad;
-- 
2.9.0

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

* Patch "[media] imx-media-of: avoid uninitialized variable warning" has been added to the 4.13-stable tree
  2017-10-04 13:34 [PATCH] [STABLE-4.13] [media] imx-media-of: avoid uninitialized variable warning Arnd Bergmann
@ 2017-10-05  9:16 ` gregkh
  2017-10-05 12:32 ` [PATCH] [STABLE-4.13] [media] imx-media-of: avoid uninitialized variable warning Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: gregkh @ 2017-10-05  9:16 UTC (permalink / raw)
  To: arnd, gregkh, hans.verkuil, mchehab, mchehab, p.zabel,
	rmk+kernel, slongerbeam, steve_longerbeam
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    [media] imx-media-of: avoid uninitialized variable warning

to the 4.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     imx-media-of-avoid-uninitialized-variable-warning.patch
and it can be found in the queue-4.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From arnd@arndb.de  Thu Oct  5 11:08:57 2017
From: Arnd Bergmann <arnd@arndb.de>
Date: Wed,  4 Oct 2017 15:34:55 +0200
Subject: [media] imx-media-of: avoid uninitialized variable warning
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>, stable@vger.kernel.org, Philipp Zabel <p.zabel@pengutronix.de>, Steve Longerbeam <steve_longerbeam@mentor.com>, Hans Verkuil <hans.verkuil@cisco.com>, Mauro Carvalho Chehab <mchehab@s-opensource.com>, Steve Longerbeam <slongerbeam@gmail.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Russell King <rmk+kernel@armlinux.org.uk>, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Message-ID: <20171004133507.3539072-1-arnd@arndb.de>


From: Arnd Bergmann <arnd@arndb.de>

Replaces upstream commit 0b2e9e7947e7 ("media: staging/imx: remove
confusing IS_ERR_OR_NULL usage")

We get a harmless warning about a potential uninitialized variable
use in the driver:

drivers/staging/media/imx/imx-media-of.c: In function 'of_parse_subdev':
drivers/staging/media/imx/imx-media-of.c:216:4: warning: 'remote_np' may be used uninitialized in this function [-Wmaybe-uninitialized]

I reworked that code to be easier to understand by gcc in mainline,
but that commit is too large to backport. This is a much simpler
workaround, avoiding the warning by adding a fake initialization
to the variable. The driver was only introduced in linux-4.13,
so the workaround is not needed for earlier stable kernels.

Fixes: e130291212df ("[media] media: Add i.MX media core driver")
Cc: stable@vger.kernel.org
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Steve Longerbeam <steve_longerbeam@mentor.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/staging/media/imx/imx-media-of.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/media/imx/imx-media-of.c
+++ b/drivers/staging/media/imx/imx-media-of.c
@@ -167,7 +167,7 @@ of_parse_subdev(struct imx_media_dev *im
 		of_parse_sensor(imxmd, imxsd, sd_np);
 
 	for (i = 0; i < num_pads; i++) {
-		struct device_node *epnode = NULL, *port, *remote_np;
+		struct device_node *epnode = NULL, *port, *remote_np = NULL;
 		struct imx_media_subdev *remote_imxsd;
 		struct imx_media_pad *pad;
 		int remote_pad;


Patches currently in stable-queue which might be from arnd@arndb.de are

queue-4.13/imx-media-of-avoid-uninitialized-variable-warning.patch

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

* Re: [PATCH] [STABLE-4.13] [media] imx-media-of: avoid uninitialized variable warning
  2017-10-04 13:34 [PATCH] [STABLE-4.13] [media] imx-media-of: avoid uninitialized variable warning Arnd Bergmann
  2017-10-05  9:16 ` Patch "[media] imx-media-of: avoid uninitialized variable warning" has been added to the 4.13-stable tree gregkh
@ 2017-10-05 12:32 ` Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2017-10-05 12:32 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Greg Kroah-Hartman, devel, Steve Longerbeam, linux-kernel,
	stable, Mauro Carvalho Chehab, Russell King, Hans Verkuil,
	Philipp Zabel, Steve Longerbeam, Mauro Carvalho Chehab,
	linux-media

On Wed, Oct 04, 2017 at 03:34:55PM +0200, Arnd Bergmann wrote:
> Replaces upstream commit 0b2e9e7947e7 ("media: staging/imx: remove
> confusing IS_ERR_OR_NULL usage")
> 
> We get a harmless warning about a potential uninitialized variable
> use in the driver:
> 
> drivers/staging/media/imx/imx-media-of.c: In function 'of_parse_subdev':
> drivers/staging/media/imx/imx-media-of.c:216:4: warning: 'remote_np' may be used uninitialized in this function [-Wmaybe-uninitialized]
> 
> I reworked that code to be easier to understand by gcc in mainline,
> but that commit is too large to backport. This is a much simpler
> workaround, avoiding the warning by adding a fake initialization
> to the variable. The driver was only introduced in linux-4.13,
> so the workaround is not needed for earlier stable kernels.
> 
> Fixes: e130291212df ("[media] media: Add i.MX media core driver")

I normally leave off the Fixes tag when it's not a bugfix.  The warning
is, as you mentioned, harmless.

regards,
dan carpenter

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

end of thread, other threads:[~2017-10-05 12:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-04 13:34 [PATCH] [STABLE-4.13] [media] imx-media-of: avoid uninitialized variable warning Arnd Bergmann
2017-10-05  9:16 ` Patch "[media] imx-media-of: avoid uninitialized variable warning" has been added to the 4.13-stable tree gregkh
2017-10-05 12:32 ` [PATCH] [STABLE-4.13] [media] imx-media-of: avoid uninitialized variable warning Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.