Skip to content

Commit

Permalink
net: cisco: enic: simplify the return vnic_cq_alloc()
Browse files Browse the repository at this point in the history
Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Zheng Yongjun authored and David S. Miller committed Dec 10, 2020
1 parent dd0e7aa commit d867bc3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/net/ethernet/cisco/enic/vnic_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ void vnic_cq_free(struct vnic_cq *cq)
int vnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int index,
unsigned int desc_count, unsigned int desc_size)
{
int err;

cq->index = index;
cq->vdev = vdev;

Expand All @@ -47,11 +45,7 @@ int vnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int index,
return -EINVAL;
}

err = vnic_dev_alloc_desc_ring(vdev, &cq->ring, desc_count, desc_size);
if (err)
return err;

return 0;
return vnic_dev_alloc_desc_ring(vdev, &cq->ring, desc_count, desc_size);
}

void vnic_cq_init(struct vnic_cq *cq, unsigned int flow_control_enable,
Expand Down

0 comments on commit d867bc3

Please sign in to comment.