kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/ast: fix missing break in switch statement for format->cpp[0] case 4
@ 2020-06-10 11:58 Colin King
  2020-06-10 17:14 ` Thomas Zimmermann
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-06-10 11:58 UTC (permalink / raw)
  To: Dave Airlie, David Airlie, Daniel Vetter, Thomas Zimmermann,
	Gerd Hoffmann, dri-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently the switch statement for format->cpp[0] value 4 assigns
color_index which is never read again and then falls through to the
default case and returns. This looks like a missing break statement
bug. Fix this by adding a break statement.

Addresses-Coverity: ("Unused value")
Fixes: 259d14a76a27 ("drm/ast: Split ast_set_vbios_mode_info()")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/ast/ast_mode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 7d39b858c9f1..3a3a511670c9 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -226,6 +226,7 @@ static void ast_set_vbios_color_reg(struct ast_private *ast,
 	case 3:
 	case 4:
 		color_index = TrueCModeIndex;
+		break;
 	default:
 		return;
 	}
-- 
2.27.0.rc0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/ast: fix missing break in switch statement for format->cpp[0] case 4
  2020-06-10 11:58 [PATCH] drm/ast: fix missing break in switch statement for format->cpp[0] case 4 Colin King
@ 2020-06-10 17:14 ` Thomas Zimmermann
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Zimmermann @ 2020-06-10 17:14 UTC (permalink / raw)
  To: Colin King, Dave Airlie, David Airlie, Daniel Vetter,
	Gerd Hoffmann, dri-devel
  Cc: kernel-janitors, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1365 bytes --]

Hi

Am 10.06.20 um 13:58 schrieb Colin King:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently the switch statement for format->cpp[0] value 4 assigns
> color_index which is never read again and then falls through to the
> default case and returns. This looks like a missing break statement
> bug. Fix this by adding a break statement.
> 
> Addresses-Coverity: ("Unused value")
> Fixes: 259d14a76a27 ("drm/ast: Split ast_set_vbios_mode_info()")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

Thanks for the fix. I'll test and merge the patch tomorrow.

Best regards
Thomas

> ---
>  drivers/gpu/drm/ast/ast_mode.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
> index 7d39b858c9f1..3a3a511670c9 100644
> --- a/drivers/gpu/drm/ast/ast_mode.c
> +++ b/drivers/gpu/drm/ast/ast_mode.c
> @@ -226,6 +226,7 @@ static void ast_set_vbios_color_reg(struct ast_private *ast,
>  	case 3:
>  	case 4:
>  		color_index = TrueCModeIndex;
> +		break;
>  	default:
>  		return;
>  	}
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-10 17:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10 11:58 [PATCH] drm/ast: fix missing break in switch statement for format->cpp[0] case 4 Colin King
2020-06-10 17:14 ` Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).