kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] drm/mgag200: add in missing { } around if block
@ 2019-06-14 14:39 Colin King
  2019-06-27  7:57 ` Thomas Zimmermann
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2019-06-14 14:39 UTC (permalink / raw)
  To: Thomas Zimmermann, Dave Airlie, David Airlie, Daniel Vetter, dri-devel
  Cc: kernel-janitors, linux-kernel

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

There is an if block that is missing the { } curly brackets. Add
these in.

Addresses-Coverity: ("Structurally dead code")
Fixes: 94dc57b10399 ("drm/mgag200: Rewrite cursor handling")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/mgag200/mgag200_cursor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_cursor.c b/drivers/gpu/drm/mgag200/mgag200_cursor.c
index f0c61a92351c..117eaedec7aa 100644
--- a/drivers/gpu/drm/mgag200/mgag200_cursor.c
+++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c
@@ -99,10 +99,11 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc,
 
 	/* Pin and map up-coming buffer to write colour indices */
 	ret = drm_gem_vram_pin(pixels_next, 0);
-	if (ret)
+	if (ret) {
 		dev_err(&dev->pdev->dev,
 			"failed to pin cursor buffer: %d\n", ret);
 		goto err_drm_gem_vram_kunmap_src;
+	}
 	dst = drm_gem_vram_kmap(pixels_next, true, NULL);
 	if (IS_ERR(dst)) {
 		ret = PTR_ERR(dst);
-- 
2.20.1

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

* Re: [PATCH][next] drm/mgag200: add in missing { } around if block
  2019-06-14 14:39 [PATCH][next] drm/mgag200: add in missing { } around if block Colin King
@ 2019-06-27  7:57 ` Thomas Zimmermann
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Zimmermann @ 2019-06-27  7:57 UTC (permalink / raw)
  To: Colin King, Dave Airlie, David Airlie, Daniel Vetter, dri-devel
  Cc: kernel-janitors, linux-kernel


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

The code still used to work because mgag200 and userspace switch to a
software cursor if the HW cursor is not available. Thank you for fixing
this bug.

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

Am 14.06.19 um 16:39 schrieb Colin King:
> From: Colin Ian King <colin.king@canonical.com>
> 
> There is an if block that is missing the { } curly brackets. Add
> these in.
> 
> Addresses-Coverity: ("Structurally dead code")
> Fixes: 94dc57b10399 ("drm/mgag200: Rewrite cursor handling")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/gpu/drm/mgag200/mgag200_cursor.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/mgag200/mgag200_cursor.c b/drivers/gpu/drm/mgag200/mgag200_cursor.c
> index f0c61a92351c..117eaedec7aa 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_cursor.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c
> @@ -99,10 +99,11 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc,
>  
>  	/* Pin and map up-coming buffer to write colour indices */
>  	ret = drm_gem_vram_pin(pixels_next, 0);
> -	if (ret)
> +	if (ret) {
>  		dev_err(&dev->pdev->dev,
>  			"failed to pin cursor buffer: %d\n", ret);
>  		goto err_drm_gem_vram_kunmap_src;
> +	}
>  	dst = drm_gem_vram_kmap(pixels_next, true, NULL);
>  	if (IS_ERR(dst)) {
>  		ret = PTR_ERR(dst);
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)


[-- 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:[~2019-06-27  7:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 14:39 [PATCH][next] drm/mgag200: add in missing { } around if block Colin King
2019-06-27  7:57 ` 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).