]> git.baikalelectronics.ru Git - kernel.git/commit
media: platform: return early if the iface is not handled
authorTom Rix <trix@redhat.com>
Sat, 19 Mar 2022 14:34:56 +0000 (15:34 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 13 May 2022 09:02:18 +0000 (11:02 +0200)
commit312beb50fdff755e847f588d32be6a9a0917d6dc
tree95febd35ff3b954f17abb304936323be43f9d302
parent188f24b8ee275d077f554c3ee0a93561e239c4e3
media: platform: return early if the iface is not handled

Clang static analysis reports this issue
ispcsiphy.c:63:14: warning: The left operand of '<<'
  is a garbage value
        reg |= mode << shift;
               ~~~~ ^
The iface switch-statement default case falls through
to ISP_INTERFACE_CCP2B_PHY1.  Which is later checked
to set the mode.  Since the default case is left out
of this check mode is never set.  Instead of falling
through and assuming a ISP_INTERFACE_CCP2B_PHY1
iface, return.

Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/ti/omap3isp/ispcsiphy.c