diff options
author | Anatolij Gustschin <agust@denx.de> | 2020-01-06 23:00:38 +0100 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2020-02-04 23:02:56 +0100 |
commit | ab6ea931deeb8e435aeeb251bac7a2433e016271 (patch) | |
tree | 2a71446d3df4743e93bd2c08688ca96da37ff51f /drivers/video | |
parent | d861183dc531b74479f92bf4c8de8ad60a0a0d56 (diff) |
video: fix Coverity missing break issue
Fix:
>>> CID 280902: Control flow issues (MISSING_BREAK)
>>> The case for value "VIDEO_BPP32" is not terminated
>>> by a 'break' statement.
Also fix
error: control reaches end of non-void function [-Werror=return-type]
Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/vidconsole-uclass.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 75c7e25095..8e0fc7f3ec 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -144,22 +144,26 @@ u32 vid_console_color(struct video_priv *priv, unsigned int idx) ((colors[idx].g >> 2) << 5) | ((colors[idx].b >> 3) << 0); } + break; case VIDEO_BPP32: if (CONFIG_IS_ENABLED(VIDEO_BPP32)) { return (colors[idx].r << 16) | (colors[idx].g << 8) | (colors[idx].b << 0); } + break; default: - /* - * For unknown bit arrangements just support - * black and white. - */ - if (idx) - return 0xffffff; /* white */ - else - return 0x000000; /* black */ + break; } + + /* + * For unknown bit arrangements just support + * black and white. + */ + if (idx) + return 0xffffff; /* white */ + + return 0x000000; /* black */ } static char *parsenum(char *s, int *num) |