Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Michał Winiarski" <michal.winiarski@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH 2/3] drm/i915: Fix uninitialized variable warning
Date: Wed, 18 Oct 2023 09:27:46 -0400	[thread overview]
Message-ID: <ZS/dUoMmee1mtnin@intel.com> (raw)
In-Reply-To: <20231018115826.3908905-3-michal.winiarski@intel.com>

On Wed, Oct 18, 2023 at 01:58:25PM +0200, Michał Winiarski wrote:
> When used with Xe, "val" uses as function argument name clashes with
> "val" used inside iosys_map_* macro causing the build to fail with:
> 
> drivers/gpu/drm/i915/display/intel_dsb.c:87:46: error: variable 'val' is uninitialized when used within its own initialization [-Werror,-Wuninitialized]
> 
> Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_dsb.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c
> index 796b1b36dc598..8d89c8f700d68 100644
> --- a/drivers/gpu/drm/i915/display/intel_dsb.c
> +++ b/drivers/gpu/drm/i915/display/intel_dsb.c
> @@ -79,12 +79,12 @@ static u32 dsb_ggtt_offset(struct intel_dsb *dsb)
>  #endif
>  }
>  
> -static void dsb_write(struct intel_dsb *dsb, u32 idx, u32 val)
> +static void dsb_write(struct intel_dsb *dsb, u32 idx, u32 value)
>  {
>  #ifdef I915
> -	dsb->cmd_buf[idx] = val;
> +	dsb->cmd_buf[idx] = value;
>  #else
> -	iosys_map_wr(&dsb->obj->vmap, idx * 4, u32, val);
> +	iosys_map_wr(&dsb->obj->vmap, idx * 4, u32, value);
>  #endif
>  }
>  
> @@ -97,12 +97,12 @@ static u32 dsb_read(struct intel_dsb *dsb, u32 idx)
>  #endif
>  }
>  
> -static void dsb_memset(struct intel_dsb *dsb, u32 idx, u32 val, u32 sz)
> +static void dsb_memset(struct intel_dsb *dsb, u32 idx, u32 value, u32 sz)
>  {
>  #ifdef I915
> -	memset(&dsb->cmd_buf[idx], val, sz);
> +	memset(&dsb->cmd_buf[idx], value, sz);
>  #else
> -	iosys_map_memset(&dsb->obj->vmap, idx * 4, val, sz);
> +	iosys_map_memset(&dsb->obj->vmap, idx * 4, value, sz);
>  #endif
>  }
>  
> -- 
> 2.42.0
> 

  reply	other threads:[~2023-10-18 13:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 11:58 [Intel-xe] [PATCH 0/3] drm/xe: Fix building with clang Michał Winiarski
2023-10-18 11:58 ` [Intel-xe] [PATCH 1/3] drm/xe: Fix header guard warning Michał Winiarski
2023-10-18 13:27   ` Rodrigo Vivi
2023-10-18 11:58 ` [Intel-xe] [PATCH 2/3] drm/i915: Fix uninitialized variable warning Michał Winiarski
2023-10-18 13:27   ` Rodrigo Vivi [this message]
2023-10-18 16:54   ` Lucas De Marchi
2023-10-19 12:55     ` Upadhyay, Tejas
2023-10-24 10:50   ` Jani Nikula
2023-10-18 11:58 ` [Intel-xe] [PATCH 3/3] drm/xe: Fix format string security warning Michał Winiarski
2023-10-18 13:28   ` Rodrigo Vivi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZS/dUoMmee1mtnin@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=michal.winiarski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox