diff mbox

infiniband: hw: i40iw: fix duplicated code for different branches

Message ID 20170518181117.GA14287@embeddedgus (mailing list archive)
State Accepted
Headers show

Commit Message

Gustavo A. R. Silva May 18, 2017, 6:11 p.m. UTC
Refactor code to avoid identical code for different branches.

Addresses-Coverity-ID: 1357356
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/infiniband/hw/i40iw/i40iw_virtchnl.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Shiraz Saleem May 19, 2017, 4:59 p.m. UTC | #1
On Thu, May 18, 2017 at 01:11:17PM -0500, Gustavo A. R. Silva wrote:
> Refactor code to avoid identical code for different branches.
> 
> Addresses-Coverity-ID: 1357356
> Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
>  drivers/infiniband/hw/i40iw/i40iw_virtchnl.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/i40iw/i40iw_virtchnl.c b/drivers/infiniband/hw/i40iw/i40iw_virtchnl.c
> index f4d1368..48fd327 100644
> --- a/drivers/infiniband/hw/i40iw/i40iw_virtchnl.c
> +++ b/drivers/infiniband/hw/i40iw/i40iw_virtchnl.c
> @@ -443,10 +443,7 @@ enum i40iw_status_code i40iw_vchnl_recv_pf(struct i40iw_sc_dev *dev,
>  	if (!dev->vchnl_up)
>  		return I40IW_ERR_NOT_READY;
>  	if (vchnl_msg->iw_op_code == I40IW_VCHNL_OP_GET_VER) {
> -		if (vchnl_msg->iw_op_ver != I40IW_VCHNL_OP_GET_VER_V0)
> -			vchnl_pf_send_get_ver_resp(dev, vf_id, vchnl_msg);
> -		else
> -			vchnl_pf_send_get_ver_resp(dev, vf_id, vchnl_msg);
> +		vchnl_pf_send_get_ver_resp(dev, vf_id, vchnl_msg);
>  		return I40IW_SUCCESS;
>  	}
>  	for (iw_vf_idx = 0; iw_vf_idx < I40IW_MAX_PE_ENABLED_VF_COUNT; iw_vf_idx++) {
> --

Acked-by: Shiraz Saleem <shiraz.saleem@intel.com> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford June 1, 2017, 10:27 p.m. UTC | #2
On Thu, 2017-05-18 at 13:11 -0500, Gustavo A. R. Silva wrote:
> Refactor code to avoid identical code for different branches.
> 
> Addresses-Coverity-ID: 1357356
> Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Thanks, applied.
diff mbox

Patch

diff --git a/drivers/infiniband/hw/i40iw/i40iw_virtchnl.c b/drivers/infiniband/hw/i40iw/i40iw_virtchnl.c
index f4d1368..48fd327 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_virtchnl.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_virtchnl.c
@@ -443,10 +443,7 @@  enum i40iw_status_code i40iw_vchnl_recv_pf(struct i40iw_sc_dev *dev,
 	if (!dev->vchnl_up)
 		return I40IW_ERR_NOT_READY;
 	if (vchnl_msg->iw_op_code == I40IW_VCHNL_OP_GET_VER) {
-		if (vchnl_msg->iw_op_ver != I40IW_VCHNL_OP_GET_VER_V0)
-			vchnl_pf_send_get_ver_resp(dev, vf_id, vchnl_msg);
-		else
-			vchnl_pf_send_get_ver_resp(dev, vf_id, vchnl_msg);
+		vchnl_pf_send_get_ver_resp(dev, vf_id, vchnl_msg);
 		return I40IW_SUCCESS;
 	}
 	for (iw_vf_idx = 0; iw_vf_idx < I40IW_MAX_PE_ENABLED_VF_COUNT; iw_vf_idx++) {