drm/amdgpu: Remove useless else if
Subsystems (2)
PATCH 1/1 drm/amdgpu: Remove useless else if
The assignment of the else and if branches is the same, so the if else here is redundant, so we remove it.
./drivers/gpu/drm/amd/amdgpu/nv.c:1048:2-4: WARNING: possible condition with no effect (if == else).
Reported-by Abaci Robot <[email protected]>
Signed-off-by Jiapeng Chong <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/nv.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/amdgpu/nv.c +5 -13
@@ -1045,19 +1045,11 @@ static int nv_common_late_init(void *handle)if (amdgpu_sriov_vf (adev)) {xgpu_nv_mailbox_get_irq (adev); -if (adev->vcn.harvest_config &AMDGPU_VCN_HARVEST_VCN0 ) { -amdgpu_virt_update_sriov_video_codec (adev, - sriov_sc_video_codecs_encode_array, -ARRAY_SIZE (sriov_sc_video_codecs_encode_array), - sriov_sc_video_codecs_decode_array_vcn1, -ARRAY_SIZE (sriov_sc_video_codecs_decode_array_vcn1)); - }else { -amdgpu_virt_update_sriov_video_codec (adev, - sriov_sc_video_codecs_encode_array, -ARRAY_SIZE (sriov_sc_video_codecs_encode_array), - sriov_sc_video_codecs_decode_array_vcn1, -ARRAY_SIZE (sriov_sc_video_codecs_decode_array_vcn1)); - } +amdgpu_virt_update_sriov_video_codec (adev, + sriov_sc_video_codecs_encode_array, +ARRAY_SIZE (sriov_sc_video_codecs_encode_array), + sriov_sc_video_codecs_decode_array_vcn1, +ARRAY_SIZE (sriov_sc_video_codecs_decode_array_vcn1)); }return 0 ;
Signature · 1 line
2.20.1.7.g153144c
Quoted 23 lines · Jiapeng Chong
The assignment of the else and if branches is the same, so the if else here is redundant, so we remove it.
./drivers/gpu/drm/amd/amdgpu/nv.c:1048:2-4: WARNING: possible condition with no effect (if == else).
Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>--- drivers/gpu/drm/amd/amdgpu/nv.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-)drivers/gpu/drm/amd/amdgpu/nv.c +0
-2@@ -1045,19 +1045,11 @@ static int nv_common_late_init(void *handle)if (amdgpu_sriov_vf (adev)) {xgpu_nv_mailbox_get_irq (adev); -if (adev->vcn.harvest_config &AMDGPU_VCN_HARVEST_VCN0 ) { - amdgpu_virt_update_sriov_video_codec(adev,
drivers/gpu/drm/amd/amdgpu/nv.c static int nv_common_late_init(void *handle) · line 1059
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/nv.c +0
-10- sriov_sc_video_codecs_encode_array, -ARRAY_SIZE (sriov_sc_video_codecs_encode_array), - sriov_sc_video_codecs_decode_array_vcn1, - ARRAY_SIZE(sriov_sc_video_codecs_decode_array_vcn1)); - }else { -amdgpu_virt_update_sriov_video_codec (adev, - sriov_sc_video_codecs_encode_array, -ARRAY_SIZE (sriov_sc_video_codecs_encode_array), - sriov_sc_video_codecs_decode_array_vcn1, -ARRAY_SIZE (sriov_sc_video_codecs_decode_array_vcn1));
This should be vcn0. I'll send out a patch. Thanks!
Alex
Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/nv.c +5
-2- } +amdgpu_virt_update_sriov_video_codec (adev, + sriov_sc_video_codecs_encode_array, +ARRAY_SIZE (sriov_sc_video_codecs_encode_array), + sriov_sc_video_codecs_decode_array_vcn1, +ARRAY_SIZE (sriov_sc_video_codecs_decode_array_vcn1)); }return 0 ; --2.20.1.7.g153144c