[PATCH -next] drm/amdgpu: Remove a lot of unnecessary ternary operators

2023-08-01 Thread Ruan Jinjie
Ther are many ternary operators, the true or false judgement of which is unnecessary in C language semantics. Signed-off-by: Ruan Jinjie --- drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 2 +- drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c

Re: [PATCH -next] drm/amdgpu: Remove a lot of unnecessary ternary operators

2023-08-01 Thread Ruan Jinjie
On 2023/8/1 0:14, Limonciello, Mario wrote: > > > On 7/31/2023 8:26 AM, Ruan Jinjie wrote: >> Ther are many ternary operators, the true or false judgement >> of which is unnecessary in C language semantics. > s/Ther/There/ > > Unnecessary; sure.  But don't

Re: [PATCH -next] drm/amdgpu: Remove a lot of unnecessary ternary operators

2023-08-01 Thread Ruan Jinjie
On 2023/8/1 0:22, Tom Rix wrote: > > On 7/31/23 6:26 AM, Ruan Jinjie wrote: >> Ther are many ternary operators, the true or false judgement >> of which is unnecessary in C language semantics. >> >> Signed-off-by: Ruan Jinjie >> --- > > sni

[PATCH -next] drm/amd/pm: Remove many unnecessary NULL values

2023-08-02 Thread Ruan Jinjie
Ther are many pointers assigned first, which need not to be initialized, so remove the NULL assignment. Signed-off-by: Ruan Jinjie --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/processpptables.c | 2 +- drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c | 2 +- drivers/gpu/drm/amd/pm

[PATCH -next v2] drm/amdgpu: Remove a lot of unnecessary ternary operators

2023-08-04 Thread Ruan Jinjie
There are many ternary operators, the true or false judgement of which is unnecessary in C language semantics. Signed-off-by: Ruan Jinjie --- v2: - add the wrong removed true or false judgement hunk code - Update the commit message, Ther -> There --- drivers/gpu/drm/amd/amdgpu/amdgpu_bio

[PATCH -next 1/7] drm/amdkfd: Remove unnecessary NULL values

2023-08-09 Thread Ruan Jinjie
The NULL initialization of the pointers assigned by kzalloc() first is not necessary, because if the kzalloc() failed, the pointers will be assigned NULL, otherwise it works as usual. so remove it. Signed-off-by: Ruan Jinjie --- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c | 4 ++-- 1 file

[PATCH -next 5/7] drm/virtio: Remove an unnecessary NULL value

2023-08-09 Thread Ruan Jinjie
The NULL initialization of the pointer assigned by kzalloc() first is not necessary, because if the kzalloc() failed, the pointer will be assigned NULL, otherwise it works as usual. so remove it. Signed-off-by: Ruan Jinjie --- drivers/gpu/drm/virtio/virtgpu_submit.c | 2 +- 1 file changed, 1

[PATCH -next 6/7] drm/format-helper: Remove unnecessary NULL values

2023-08-09 Thread Ruan Jinjie
The NULL initialization of the pointers assigned by kunit_kzalloc() first is not necessary, because if kunit_kzalloc() failed, the pointers will be assigned NULL, otherwise it works as usual. so remove it. Signed-off-by: Ruan Jinjie --- .../gpu/drm/tests/drm_format_helper_test.c| 28

[PATCH -next 3/7] drm/msm: Remove unnecessary NULL values

2023-08-09 Thread Ruan Jinjie
The NULL initialization of the pointers assigned by kzalloc() first is not necessary, because if the kzalloc() failed, the pointers will be assigned NULL, otherwise it works as usual. so remove it. Signed-off-by: Ruan Jinjie --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 +- drivers/gpu/drm

[PATCH -next 7/7] drm: Remove unnecessary NULL values

2023-08-09 Thread Ruan Jinjie
The NULL initialization of the pointers assigned by kzalloc() first is not necessary, because if the kzalloc() failed, the pointers will be assigned NULL, otherwise it works as usual. so remove it. Signed-off-by: Ruan Jinjie --- drivers/gpu/drm/drm_agpsupport.c | 2 +- drivers/gpu/drm

[PATCH -next 0/7] drm: Remove many unnecessary NULL values

2023-08-09 Thread Ruan Jinjie
The NULL initialization of the pointers assigned by kzalloc() or kunit_kzalloc() first is not necessary, because if the kzalloc() or kunit_kzalloc() failed, the pointers will be assigned NULL, otherwise it works as usual. so remove it. Ruan Jinjie (7): drm/amdkfd: Remove unnecessary NULL values

[PATCH -next 4/7] drm/radeon: Remove unnecessary NULL values

2023-08-09 Thread Ruan Jinjie
The NULL initialization of the pointers assigned by kzalloc() first is not necessary, because if the kzalloc() failed, the pointers will be assigned NULL, otherwise it works as usual. so remove it. Signed-off-by: Ruan Jinjie --- drivers/gpu/drm/radeon/radeon_agp.c | 2 +- drivers

[PATCH -next 2/7] drm/amd/display: Remove unnecessary NULL values

2023-08-09 Thread Ruan Jinjie
The NULL initialization of the pointers assigned by kzalloc() first is not necessary, because if the kzalloc() failed, the pointers will be assigned NULL, otherwise it works as usual. so remove it. Signed-off-by: Ruan Jinjie --- drivers/gpu/drm/amd/display/dc/bios/bios_parser.c | 4