public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] snic: fix simple_return.cocci warnings
       [not found] <201508160048.2w7j18Q2%fengguang.wu@intel.com>
@ 2015-08-15 16:34 ` kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2015-08-15 16:34 UTC (permalink / raw)
  To: Narsimhulu Musini
  Cc: kbuild-all, James Bottomley, Sesidhar Baddela, Hannes Reinecke,
	linux-scsi, linux-kernel

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(-)

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-15 16:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <201508160048.2w7j18Q2%fengguang.wu@intel.com>
2015-08-15 16:34 ` [PATCH] snic: fix simple_return.cocci warnings kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox