]> git.baikalelectronics.ru Git - kernel.git/commit
media: camss: csiphy-3ph: avoid undefined behavior
authorArnd Bergmann <arnd@arndb.de>
Thu, 15 Dec 2022 16:28:46 +0000 (17:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:43 +0000 (09:33 +0100)
commitea41e0a8938dd5c3c74aa9565255b8072fdb92e5
tree7902ae8dc5559fdb56ca79c72c3ec795f979cc9c
parenta20fad486c396aeeae47b3157d50a8592cedd10a
media: camss: csiphy-3ph: avoid undefined behavior

[ Upstream commit 0f792b9a989716d19b23eb1cb383ec4fafc23e3c ]

Marking a case of the switch statement as unreachable means the
compiler treats it as undefined behavior, which is then caught by
an objtool warning:

drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.o: warning: objtool: csiphy_lanes_enable() falls through to next function csiphy_lanes_disable()

Instead of simply continuing execution at a random place of the
driver, print a warning and return from to the caller, which
makes it possible to understand what happens and avoids the
warning.

Fixes: 9017fa569b16 ("media: camss: csiphy-3ph: add support for SM8250 CSI DPHY")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c