lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00e7ce33-cc0a-4249-ac18-081ab9ead243@amd.com>
Date: Tue, 19 Aug 2025 10:41:37 +0200
From: Christian König <christian.koenig@....com>
To: Liao Yuanhong <liaoyuanhong@...o.com>,
 Alex Deucher <alexander.deucher@....com>, David Airlie <airlied@...il.com>,
 Simona Vetter <simona@...ll.ch>, Thomas Gleixner <tglx@...utronix.de>,
 Ingo Molnar <mingo@...nel.org>,
 Srinivasan Shanmugam <srinivasan.shanmugam@....com>,
 Lijo Lazar <lijo.lazar@....com>,
 "open list:RADEON and AMDGPU DRM DRIVERS" <amd-gfx@...ts.freedesktop.org>,
 "open list:DRM DRIVERS" <dri-devel@...ts.freedesktop.org>,
 open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/amdgpu/fence: Remove redundant 0 value initialization

On 19.08.25 10:25, Liao Yuanhong wrote:
> The amdgpu_fence struct is already zeroed by kzalloc(). It's redundant to
> initialize am_fence->context to 0.
> 
> Signed-off-by: Liao Yuanhong <liaoyuanhong@...o.com>

Reviewed-by: Christian König <christian.koenig@....com>

If you want a challenge what we would really use is a scan of all the structures defined in drivers/gpu/drm/amd/amdgpu/*.[ch] for unused fields.

The UAPI and BIOS/HW header files are full of padding fields, but there shouldn't be any in the driver core defines and we sometimes forget to remove fields from structures when they are not used any more.

Regards,
Christian.

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> index bcb74286a78a..fd8cca241da6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> @@ -120,7 +120,6 @@ int amdgpu_fence_emit(struct amdgpu_ring *ring, struct dma_fence **f,
>  		am_fence = kzalloc(sizeof(*am_fence), GFP_KERNEL);
>  		if (!am_fence)
>  			return -ENOMEM;
> -		am_fence->context = 0;
>  	} else {
>  		am_fence = af;
>  	}


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ