]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
media: cx18: Don't check for address of video_dev
authorNathan Chancellor <natechancellor@gmail.com>
Mon, 1 Oct 2018 15:21:11 +0000 (11:21 -0400)
committerKhalid Elmously <khalid.elmously@canonical.com>
Thu, 28 Nov 2019 04:59:27 +0000 (23:59 -0500)
BugLink: https://bugs.launchpad.net/bugs/1854216
[ Upstream commit eb1ca9a428fdc3f98be4898f6cd8bcb803878619 ]

Clang warns that the address of a pointer will always evaluated as true
in a boolean context.

drivers/media/pci/cx18/cx18-driver.c:1255:23: warning: address of
'cx->streams[i].video_dev' will always evaluate to 'true'
[-Wpointer-bool-conversion]
                if (&cx->streams[i].video_dev)
                ~~   ~~~~~~~~~~~~~~~^~~~~~~~~
1 warning generated.

Check whether v4l2_dev is null, not the address, so that the statement
doesn't fire all the time. This check has been present since 2009,
introduced by commit 21a278b85d3c ("V4L/DVB (11619): cx18: Simplify the
work handler for outgoing mailbox commands")

Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/media/pci/cx18/cx18-driver.c

index 8f314ca320c73b2dce41eef213d094576a5e6a4e..4f3de01adf0c239e9873c4e9aeb019665124e464 100644 (file)
@@ -1254,7 +1254,7 @@ static void cx18_cancel_out_work_orders(struct cx18 *cx)
 {
        int i;
        for (i = 0; i < CX18_MAX_STREAMS; i++)
-               if (&cx->streams[i].video_dev)
+               if (cx->streams[i].video_dev.v4l2_dev)
                        cancel_work_sync(&cx->streams[i].out_work_order);
 }