]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
imx-media-of: avoid uninitialized variable warning
authorArnd Bergmann <arnd@arndb.de>
Wed, 4 Oct 2017 13:34:55 +0000 (15:34 +0200)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 19 Oct 2017 14:48:19 +0000 (09:48 -0500)
commitff738ef74699e806a7b71d0833baa11f56ed8d10
tree17ef1bef4ec133c1134833de2bd77784dd17918b
parent237781250732e06f01b7383e97902eab1f814192
imx-media-of: avoid uninitialized variable warning

BugLink: http://bugs.launchpad.net/bugs/1723145
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>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/staging/media/imx/imx-media-of.c