ALSA: xen-front: remove redundant error check on ret
Subsystems (3)
PATCH 1/1 ALSA: xen-front: remove redundant error check on ret
From: Colin Ian King <[email protected]>
The error for a -ve value in ret is redundant as all previous assignments to ret have an associated -ve check and hence it is impossible for ret to be less that zero at the point of the check. Remove this redundant error check.
Detected by CoveritScan, CID#1469407 ("Logically Dead code")
--- sound/xen/xen_snd_front_evtchnl.c | 2 -- 1 file changed, 2 deletions(-)
sound/xen/xen_snd_front_evtchnl.c +0 -2
@@ -351,8 +351,6 @@ int xen_snd_front_evtchnl_create_all(struct xen_snd_front_info *front_info, } } } -if (ret <0 ) - goto fail; front_info->num_evt_pairs = num_streams;return 0 ;
Signature · 1 line
2.17.0
Hi,
Quoted 19 lines · Colin King
From: Colin Ian King <[email protected]>
The error for a -ve value in ret is redundant as all previous assignments to ret have an associated -ve check and hence it is impossible for ret to be less that zero at the point of the check. Remove this redundant error check.
Detected by CoveritScan, CID#1469407 ("Logically Dead code")
Signed-off-by Colin Ian King <[email protected]>--- sound/xen/xen_snd_front_evtchnl.c | 2 -- 1 file changed, 2 deletions(-)sound/xen/xen_snd_front_evtchnl.c +0
-0
sound/xen/xen_snd_front_evtchnl.c int xen_snd_front_evtchnl_create_all(struct xen_snd_front_info *front_info, · line 356
Quoted 8 lines
sound/xen/xen_snd_front_evtchnl.c +0
-2@@ -351,8 +351,6 @@ int xen_snd_front_evtchnl_create_all(struct xen_snd_front_info *front_info, } } } -if (ret <0 ) - goto fail; front_info->num_evt_pairs = num_streams;return 0 ;
Yep. All branches for error path on the nested for loop have goto statement, thus no need to check error outer the loop.
Takashi Sakamoto
Takashi Iwai
AppliedQuoted 34 lines · Takashi Sakamoto
Hi,
Quoted 19 lines · Colin King
From: Colin Ian King <[email protected]>
The error for a -ve value in ret is redundant as all previous assignments to ret have an associated -ve check and hence it is impossible for ret to be less that zero at the point of the check. Remove this redundant error check.
Detected by CoveritScan, CID#1469407 ("Logically Dead code")
Signed-off-by Colin Ian King <[email protected]>--- sound/xen/xen_snd_front_evtchnl.c | 2 -- 1 file changed, 2 deletions(-)sound/xen/xen_snd_front_evtchnl.c +0
-0sound/xen/xen_snd_front_evtchnl.c int xen_snd_front_evtchnl_create_all(struct xen_snd_front_info *front_info, · line 355
Quoted 7 lines
sound/xen/xen_snd_front_evtchnl.c +0
-2@@ -351,8 +351,6 @@ int xen_snd_front_evtchnl_create_all(struct xen_snd_front_info *front_info, } } } -if (ret <0 ) - goto fail; front_info->num_evt_pairs = num_streams;return 0 ;Yep. All branches for error path on the nested for loop have goto statement, thus no need to check error outer the loop.
Quoted 1 line
Reviewed-by Takashi Sakamoto <[email protected]>
Applied, thanks.
Takashi
Takashi Iwai
AppliedQuoted 34 lines · Takashi Sakamoto
Hi,
Quoted 19 lines · Colin King
From: Colin Ian King <[email protected]>
The error for a -ve value in ret is redundant as all previous assignments to ret have an associated -ve check and hence it is impossible for ret to be less that zero at the point of the check. Remove this redundant error check.
Detected by CoveritScan, CID#1469407 ("Logically Dead code")
Signed-off-by Colin Ian King <[email protected]>--- sound/xen/xen_snd_front_evtchnl.c | 2 -- 1 file changed, 2 deletions(-)sound/xen/xen_snd_front_evtchnl.c +0
-0sound/xen/xen_snd_front_evtchnl.c int xen_snd_front_evtchnl_create_all(struct xen_snd_front_info *front_info, · line 355
Quoted 7 lines
sound/xen/xen_snd_front_evtchnl.c +0
-2@@ -351,8 +351,6 @@ int xen_snd_front_evtchnl_create_all(struct xen_snd_front_info *front_info, } } } -if (ret <0 ) - goto fail; front_info->num_evt_pairs = num_streams;return 0 ;Yep. All branches for error path on the nested for loop have goto statement, thus no need to check error outer the loop.
Quoted 1 line
Reviewed-by Takashi Sakamoto <[email protected]>
Applied, thanks.
Takashi
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Hi,
Quoted 19 lines · Colin King
From: Colin Ian King <[email protected]>
The error for a -ve value in ret is redundant as all previous assignments to ret have an associated -ve check and hence it is impossible for ret to be less that zero at the point of the check. Remove this redundant error check.
Detected by CoveritScan, CID#1469407 ("Logically Dead code")
Signed-off-by Colin Ian King <[email protected]>--- sound/xen/xen_snd_front_evtchnl.c | 2 -- 1 file changed, 2 deletions(-)sound/xen/xen_snd_front_evtchnl.c +0
-0
sound/xen/xen_snd_front_evtchnl.c int xen_snd_front_evtchnl_create_all(struct xen_snd_front_info *front_info, · line 356
Quoted 8 lines
sound/xen/xen_snd_front_evtchnl.c +0
-2@@ -351,8 +351,6 @@ int xen_snd_front_evtchnl_create_all(struct xen_snd_front_info *front_info, } } } -if (ret <0 ) - goto fail; front_info->num_evt_pairs = num_streams;return 0 ;
Yep. All branches for error path on the nested for loop have goto statement, thus no need to check error outer the loop.
Takashi Sakamoto
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel