linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/rockchip: cdn-dp: fix cdn-dp complie warning
@ 2017-02-07  1:34 Mark Yao
  2017-02-07 16:05 ` Sean Paul
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Yao @ 2017-02-07  1:34 UTC (permalink / raw)
  To: David Airlie, Heiko Stuebner, dri-devel, linux-arm-kernel,
	linux-rockchip, linux-kernel
  Cc: Mark Yao

fix warning:

drivers/gpu/drm/rockchip/cdn-dp-reg.c:632:24: warning:
  'val[1]' may be used uninitialized in this function [-Wmaybe-uninitialized]
  msa_misc = 2 * val[0] + 32 * val[1] +

Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
---
 drivers/gpu/drm/rockchip/cdn-dp-reg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/cdn-dp-reg.c b/drivers/gpu/drm/rockchip/cdn-dp-reg.c
index 3a5b8a4..319dbba 100644
--- a/drivers/gpu/drm/rockchip/cdn-dp-reg.c
+++ b/drivers/gpu/drm/rockchip/cdn-dp-reg.c
@@ -592,7 +592,7 @@ static int cdn_dp_get_msa_misc(struct video_info *video,
 			       struct drm_display_mode *mode)
 {
 	u32 msa_misc;
-	u8 val[2];
+	u8 val[2] = {0};
 
 	switch (video->color_fmt) {
 	case PXL_RGB:
-- 
1.9.1

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

* Re: [PATCH] drm/rockchip: cdn-dp: fix cdn-dp complie warning
  2017-02-07  1:34 [PATCH] drm/rockchip: cdn-dp: fix cdn-dp complie warning Mark Yao
@ 2017-02-07 16:05 ` Sean Paul
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Paul @ 2017-02-07 16:05 UTC (permalink / raw)
  To: Mark Yao
  Cc: David Airlie, Heiko Stuebner, dri-devel, linux-arm-kernel,
	linux-rockchip, linux-kernel

On Tue, Feb 07, 2017 at 09:34:01AM +0800, Mark Yao wrote:
> fix warning:
> 
> drivers/gpu/drm/rockchip/cdn-dp-reg.c:632:24: warning:
>   'val[1]' may be used uninitialized in this function [-Wmaybe-uninitialized]
>   msa_misc = 2 * val[0] + 32 * val[1] +
> 
> Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
> ---
>  drivers/gpu/drm/rockchip/cdn-dp-reg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-reg.c b/drivers/gpu/drm/rockchip/cdn-dp-reg.c
> index 3a5b8a4..319dbba 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-reg.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-reg.c
> @@ -592,7 +592,7 @@ static int cdn_dp_get_msa_misc(struct video_info *video,
>  			       struct drm_display_mode *mode)
>  {
>  	u32 msa_misc;
> -	u8 val[2];
> +	u8 val[2] = {0};

Kind of a nit, but it would be better to add default cases to the switches below so it's more
obvious which format/depth you consider the fallback.

Sean

>  
>  	switch (video->color_fmt) {
>  	case PXL_RGB:
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Sean Paul, Software Engineer, Google / Chromium OS

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

end of thread, other threads:[~2017-02-07 16:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-07  1:34 [PATCH] drm/rockchip: cdn-dp: fix cdn-dp complie warning Mark Yao
2017-02-07 16:05 ` Sean Paul

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).