scsi: snic: Simplify the return expression of svnic_cq_alloc()

Simplify the return expression.

Link: https://lore.kernel.org/r/20200921082455.2592190-1-liushixin2@huawei.com
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Liu Shixin 2020-09-21 16:24:55 +08:00 committed by Martin K. Petersen
parent 39d0c6e770
commit 6afc12fa6e

View File

@ -31,8 +31,6 @@ void svnic_cq_free(struct vnic_cq *cq)
int svnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, int svnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq,
unsigned int index, unsigned int desc_count, unsigned int desc_size) unsigned int index, unsigned int desc_count, unsigned int desc_size)
{ {
int err;
cq->index = index; cq->index = index;
cq->vdev = vdev; cq->vdev = vdev;
@ -43,11 +41,7 @@ int svnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq,
return -EINVAL; return -EINVAL;
} }
err = svnic_dev_alloc_desc_ring(vdev, &cq->ring, desc_count, desc_size); return svnic_dev_alloc_desc_ring(vdev, &cq->ring, desc_count, desc_size);
if (err)
return err;
return 0;
} }
void svnic_cq_init(struct vnic_cq *cq, unsigned int flow_control_enable, void svnic_cq_init(struct vnic_cq *cq, unsigned int flow_control_enable,