diff mbox series

[-next] snic: simplify the return expression of svnic_cq_alloc

Message ID 20200921082455.2592190-1-liushixin2@huawei.com (mailing list archive)
State Accepted
Headers show
Series [-next] snic: simplify the return expression of svnic_cq_alloc | expand

Commit Message

Liu Shixin Sept. 21, 2020, 8:24 a.m. UTC
Simplify the return expression.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 drivers/scsi/snic/vnic_cq.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Martin K. Petersen Oct. 8, 2020, 2:36 a.m. UTC | #1
Liu,

> Simplify the return expression.

Applied to 5.10/scsi-staging, thanks!
Martin K. Petersen Oct. 13, 2020, 10:42 p.m. UTC | #2
On Mon, 21 Sep 2020 16:24:55 +0800, Liu Shixin wrote:

> Simplify the return expression.

Applied to 5.10/scsi-queue, thanks!

[1/1] scsi: snic: Simplify the return expression of svnic_cq_alloc()
      https://git.kernel.org/mkp/scsi/c/6afc12fa6e50
diff mbox series

Patch

diff --git a/drivers/scsi/snic/vnic_cq.c b/drivers/scsi/snic/vnic_cq.c
index 4c8e64e4fba6..3455dd7e73f4 100644
--- a/drivers/scsi/snic/vnic_cq.c
+++ b/drivers/scsi/snic/vnic_cq.c
@@ -31,8 +31,6 @@  void svnic_cq_free(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)
 {
-	int err;
-
 	cq->index = index;
 	cq->vdev = vdev;
 
@@ -43,11 +41,7 @@  int svnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq,
 		return -EINVAL;
 	}
 
-	err = svnic_dev_alloc_desc_ring(vdev, &cq->ring, desc_count, desc_size);
-	if (err)
-		return err;
-
-	return 0;
+	return svnic_dev_alloc_desc_ring(vdev, &cq->ring, desc_count, desc_size);
 }
 
 void svnic_cq_init(struct vnic_cq *cq, unsigned int flow_control_enable,