]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: go7007: Remove redundant if statement
authorColin Ian King <colin.i.king@gmail.com>
Thu, 27 Jul 2023 17:40:07 +0000 (19:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Sep 2023 08:46:58 +0000 (10:46 +0200)
commit928804a5d0b92d1c016b87d860c1a58586c63aaa
treecc8bea66a6d37550c5d6819b57ee7d1f4fe4b9e0
parentb5239cce0f91b13722fa2429b9c2b2760a6434f8
media: go7007: Remove redundant if statement

[ Upstream commit f33cb49081da0ec5af0888f8ecbd566bd326eed1 ]

The if statement that compares msgs[i].len != 3 is always false because
it is in a code block where msg[i].len is equal to 3. The check is
redundant and can be removed.

As detected by cppcheck static analysis:
drivers/media/usb/go7007/go7007-i2c.c:168:20: warning: Opposite inner
'if' condition leads to a dead code block. [oppositeInnerCondition]

Link: https://lore.kernel.org/linux-media/20230727174007.635572-1-colin.i.king@gmail.com
Fixes: 866b8695d67e ("Staging: add the go7007 video driver")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/usb/go7007/go7007-i2c.c