diff options
author | Arnd Bergmann <arnd@arndb.de> | 2022-12-15 17:28:46 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-10 09:33:43 +0100 |
commit | ebec3d44b874e9aaea45cdd56d68409475c521f6 (patch) | |
tree | 7902ae8dc5559fdb56ca79c72c3ec795f979cc9c | |
parent | e68b43980a90142f932fbca366c76b034cc35d59 (diff) | |
download | linux-ebec3d44b874e9aaea45cdd56d68409475c521f6.tar.gz |
media: camss: csiphy-3ph: avoid undefined behavior
[ Upstream commit 05fb9ace34b8645cb76f7e3a21b5c7b754329cae ] 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: 53655d2a0ff2 ("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>
-rw-r--r-- | drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c index 451a4c9b3d30..04baa80494c6 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c @@ -429,7 +429,8 @@ static void csiphy_gen2_config_lanes(struct csiphy_device *csiphy, array_size = ARRAY_SIZE(lane_regs_sm8250[0]); break; default: - unreachable(); + WARN(1, "unknown cspi version\n"); + return; } for (l = 0; l < 5; l++) { |