Skip to contentSkip to conversation

staging: rdma: hfi1: Remove useless return variables

PATCH Superseded Bhaktipriya Shridhar 1 participant 1 message Feb 25, 2016 Staging

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/8 staging: rdma: hfi1: Remove useless return variables

This patch removes unnecessary return variables and compresses the return logic.

The coccinelle script that finds and fixes this issue is:

@@ type T; identifier i,f; constant C; @@
- T i;
...when != i
when strict
( return -C;
|
- i =
+ return
f(...);
- return i;
)

---
Change in v2:
-No change

 drivers/staging/rdma/hfi1/chip.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/rdma/hfi1/chip.c +1 -4
index 02ba78f..46a1830 100644
@@ -1250,11 +1250,8 @@ CNTR_ELEM(#name, \
 
 u64 read_csr(const struct hfi1_devdata *dd, u32 offset)
 {
-	u64 val;
-
 	if (dd->flags & HFI1_PRESENT) {
-		val = readq((void __iomem *)dd->kregbase + offset);
-		return val;
+		return readq((void __iomem *)dd->kregbase + offset);
 	}
 	return -1;
 }

--
2.1.4