diff mbox

snic: fix simple_return.cocci warnings

Message ID 20150815163453.GA245639@ivytown2 (mailing list archive)
State New, archived
Headers show

Commit Message

Fengguang Wu Aug. 15, 2015, 4:34 p.m. UTC
drivers/scsi/snic/vnic_cq.c:46:1-4: WARNING: end returns can be simpified and declaration on line 34 can be dropped

 Simplify a trivial if-return sequence.  Possibly combine with a
 preceding function call.

Generated by: scripts/coccinelle/misc/simple_return.cocci

CC: Narsimhulu Musini <nmusini@cisco.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 vnic_cq.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- 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
 		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,