Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Hawking Zhang" <Hawking.Zhang@amd.com>,
	"Frank Min" <Frank.Min@amd.com>, "Likun Gao" <Likun.Gao@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] drm/amdgpu: Initialize data to NULL in imu_v13_0_program_rlc_ram()
Date: Mon, 30 Nov 2026 12:56:18 -0700	[thread overview]
Message-ID: <20261130195618.GA1098533@ax162> (raw)
In-Reply-To: <CADnq5_OZ=hEgN19jW92i8mQtNHPE0vGHPwDkKONNioOgqyaVLQ@mail.gmail.com>

On Mon, Nov 30, 2026 at 11:58:38AM -0500, Alex Deucher wrote:
> On Sat, Nov 28, 2026 at 11:26 AM Nathan Chancellor <nathan@kernel.org> wrote:
> >
> > Clang warns (or errors with CONFIG_WERROR=y / W=e):
> >
> >   drivers/gpu/drm/amd/amdgpu/imu_v13_0.c:264:30: error: variable 'data' is uninitialized when used here [-Werror,-Wuninitialized]
> >     264 |                         program_imu_rlc_ram(adev, data, (const u32)size);
> >         |                                                   ^~~~
> >
> > It is not wrong that data is passed to program_imu_rlc_ram()
> > uninitialized but since this warning happens early in clang's frontend,
> > it cannot see program_imu_rlc_ram() is meber called due to r being
> > -EINVAL and even if it were, data would not be dereferenced because size
> > is 0, so it is never actually used uninitialized.
> >
> > It is bad form to pass uninitialized values to functions even if they
> > are not used, so just initialize data to NULL to silence the warning, as
> > it will need to be properly set up when support for calling
> > program_imu_rlc_ram() is added.
> >
> > Fixes: 9caddf5f7de7 ("drm/amdgpu: Add imu v13 ip block v2")
> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> 
> I already squashed the identical change into the original patch last week.

Ah, my apologies. I used the tree that -next pulls in as a base (the
drm-next branch of your agd5f/linux.git) but I see now that the
drm-amdgpu-next branch of drm/amdgpu/kernel has the correction. Sorry
for the noise. I assume a sync will happen at some point to make this go
away for -next?

-- 
Cheers,
Nathan

  reply	other threads:[~2026-11-30 19:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28 16:25 [PATCH] drm/amdgpu: Initialize data to NULL in imu_v13_0_program_rlc_ram() Nathan Chancellor
2026-11-30 16:58 ` Alex Deucher
2026-11-30 19:56   ` Nathan Chancellor [this message]
2026-11-30 20:03     ` Alex Deucher

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=20261130195618.GA1098533@ax162 \
    --to=nathan@kernel.org \
    --cc=Frank.Min@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Likun.Gao@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=llvm@lists.linux.dev \
    /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