diff mbox series

net/ice/base: remove unnecessary code

Message ID 20210510032326.3163171-1-qi.z.zhang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers show
Series net/ice/base: remove unnecessary code | expand

Checks

Context Check Description
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot success github build: passed
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/checkpatch success coding style OK

Commit Message

Zhang, Qi Z May 10, 2021, 3:23 a.m. UTC
Coverty issue: 370613
Execution cannot reach this statement: "break;".
Remove the unnecessary if branch.

Fixes: 2913bc4155d2 ("net/ice/base: sign external device package programming")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_common.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Yang, Qiming May 10, 2021, 5:02 a.m. UTC | #1
> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Monday, May 10, 2021 11:23
> To: Yang, Qiming <qiming.yang@intel.com>
> Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>
> Subject: [PATCH] net/ice/base: remove unnecessary code
> 
> Coverty issue: 370613
> Execution cannot reach this statement: "break;".
> Remove the unnecessary if branch.
> 
> Fixes: 2913bc4155d2 ("net/ice/base: sign external device package
> programming")
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
>  drivers/net/ice/base/ice_common.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/net/ice/base/ice_common.c
> b/drivers/net/ice/base/ice_common.c
> index ac412a1aa7..cf0a7d4e7f 100644
> --- a/drivers/net/ice/base/ice_common.c
> +++ b/drivers/net/ice/base/ice_common.c
> @@ -2009,9 +2009,6 @@ ice_parse_common_caps(struct ice_hw *hw, struct
> ice_hw_common_caps *caps,
>  	{
>  		u8 index = cap - ICE_AQC_CAPS_EXT_TOPO_DEV_IMG0;
> 
> -		if (index >= ICE_EXT_TOPO_DEV_IMG_COUNT)
> -			break;
> -
>  		caps->ext_topo_dev_img_ver_high[index] = number;
>  		caps->ext_topo_dev_img_ver_low[index] = logical_id;
>  		caps->ext_topo_dev_img_part_num[index] =
> --
> 2.26.2

Acked-by: Qiming Yang <qiming.yang@intel.com>
Zhang, Qi Z May 10, 2021, 5:44 a.m. UTC | #2
> -----Original Message-----
> From: Yang, Qiming <qiming.yang@intel.com>
> Sent: Monday, May 10, 2021 1:02 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH] net/ice/base: remove unnecessary code
> 
> 
> > -----Original Message-----
> > From: Zhang, Qi Z <qi.z.zhang@intel.com>
> > Sent: Monday, May 10, 2021 11:23
> > To: Yang, Qiming <qiming.yang@intel.com>
> > Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>
> > Subject: [PATCH] net/ice/base: remove unnecessary code
> >
> > Coverty issue: 370613
> > Execution cannot reach this statement: "break;".
> > Remove the unnecessary if branch.
> >
> > Fixes: 2913bc4155d2 ("net/ice/base: sign external device package
> > programming")
> >
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> > ---
> >  drivers/net/ice/base/ice_common.c | 3 ---
> >  1 file changed, 3 deletions(-)
> >
> > diff --git a/drivers/net/ice/base/ice_common.c
> > b/drivers/net/ice/base/ice_common.c
> > index ac412a1aa7..cf0a7d4e7f 100644
> > --- a/drivers/net/ice/base/ice_common.c
> > +++ b/drivers/net/ice/base/ice_common.c
> > @@ -2009,9 +2009,6 @@ ice_parse_common_caps(struct ice_hw *hw,
> struct
> > ice_hw_common_caps *caps,
> >  	{
> >  		u8 index = cap - ICE_AQC_CAPS_EXT_TOPO_DEV_IMG0;
> >
> > -		if (index >= ICE_EXT_TOPO_DEV_IMG_COUNT)
> > -			break;
> > -
> >  		caps->ext_topo_dev_img_ver_high[index] = number;
> >  		caps->ext_topo_dev_img_ver_low[index] = logical_id;
> >  		caps->ext_topo_dev_img_part_num[index] =
> > --
> > 2.26.2
> 
> Acked-by: Qiming Yang <qiming.yang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
diff mbox series

Patch

diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
index ac412a1aa7..cf0a7d4e7f 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -2009,9 +2009,6 @@  ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps,
 	{
 		u8 index = cap - ICE_AQC_CAPS_EXT_TOPO_DEV_IMG0;
 
-		if (index >= ICE_EXT_TOPO_DEV_IMG_COUNT)
-			break;
-
 		caps->ext_topo_dev_img_ver_high[index] = number;
 		caps->ext_topo_dev_img_ver_low[index] = logical_id;
 		caps->ext_topo_dev_img_part_num[index] =