On Tue, Dec 1, 2026 at 4:26 AM Arnd Bergmann <[email protected]> wrote:
>
> From: Arnd Bergmann <[email protected]>
>
> clang warns about passing an uninitialized pointer into another
> function, even when that function does not access the pointer:
>
> 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);
>       |                                                   ^~~~
>
> Presumably there are plans to add an actual register array later that would
> make this similar to other versions of the imu code.  In the meantime,
> remove the unused/uninitialized pointer and just pass a hardcoded NULL/0
> argument to program_imu_rlc_ram.
>
> Fixes: 9caddf5f7de7 ("drm/amdgpu: Add imu v13 ip block v2")
> Signed-off-by: Arnd Bergmann <[email protected]>

Already fixed and squashed into the original patch.

Thanks,

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/imu_v13_0.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/imu_v13_0.c 
> b/drivers/gpu/drm/amd/amdgpu/imu_v13_0.c
> index aea418be444a..660bd587c7d7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/imu_v13_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/imu_v13_0.c
> @@ -252,8 +252,7 @@ static void program_imu_rlc_ram(struct amdgpu_device 
> *adev,
>
>  static void imu_v13_0_program_rlc_ram(struct amdgpu_device *adev)
>  {
> -       u32 reg_data, size = 0;
> -       const u32 *data;
> +       u32 reg_data;
>         int r = -EINVAL;
>
>         WREG32_SOC15(GC, 0, regGFX_IMU_RLC_RAM_INDEX, 0x2);
> @@ -261,7 +260,7 @@ static void imu_v13_0_program_rlc_ram(struct 
> amdgpu_device *adev)
>         switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
>         case IP_VERSION(13, 0, 1):
>                 if (!r)
> -                       program_imu_rlc_ram(adev, data, (const u32)size);
> +                       program_imu_rlc_ram(adev, NULL, 0);
>                 break;
>         default:
>                 BUG();
> --
> 2.53.0
>

Reply via email to