All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Michał Winiarski" <michal.winiarski@intel.com>,
	intel-xe@lists.freedesktop.org
Cc: "Michał Winiarski" <michal.winiarski@intel.com>
Subject: Re: [Intel-xe] [PATCH 2/3] drm/i915: Fix uninitialized variable warning
Date: Tue, 24 Oct 2023 13:50:21 +0300	[thread overview]
Message-ID: <87v8aw9tw2.fsf@intel.com> (raw)
In-Reply-To: <20231018115826.3908905-3-michal.winiarski@intel.com>

On Wed, 18 Oct 2023, Michał Winiarski <michal.winiarski@intel.com> 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]

Whatever the outcome of the discussion, this patch must *not* be applied
to drm-xe-next. It needs to go to upstream i915 first.

BR,
Jani.

>
> Signed-off-by: Michał Winiarski <michal.winiarski@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
>  }

-- 
Jani Nikula, Intel

  parent reply	other threads:[~2023-10-24 10:50 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
2023-10-18 16:54   ` Lucas De Marchi
2023-10-19 12:55     ` Upadhyay, Tejas
2023-10-24 10:50   ` Jani Nikula [this message]
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=87v8aw9tw2.fsf@intel.com \
    --to=jani.nikula@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.