Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1208120

[PATCH] snic: fix simple_return.cocci warnings

From kbuild test robot <fengguang.wu@intel.com>
Newsgroups linux.kernel
Subject [PATCH] snic: fix simple_return.cocci warnings
Date 2015-08-15 18:40 +0200
Message-ID <pXMEV-6WN-7@gated-at.bofh.it> (permalink)
References <pXMEV-6WN-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] snic: fix simple_return.cocci warnings kbuild test robot <fengguang.wu@intel.com> - 2015-08-15 18:40 +0200

csiph-web