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>
This commit is contained in:
parent
9fadab72a6
commit
6bf9691159
|
@ -31,7 +31,8 @@ static void csiphy_routing_cfg_3630(struct isp_csiphy *phy,
|
|||
|
||||
switch (iface) {
|
||||
default:
|
||||
/* Should not happen in practice, but let's keep the compiler happy. */
|
||||
/* Should not happen in practice, but let's keep the compiler happy. */
|
||||
return;
|
||||
case ISP_INTERFACE_CCP2B_PHY1:
|
||||
reg &= ~OMAP3630_CONTROL_CAMERA_PHY_CTRL_CSI1_RX_SEL_PHY2;
|
||||
shift = OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_PHY1_SHIFT;
|
||||
|
|
Loading…
Reference in New Issue