summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBhaktipriya Shridhar <bhaktipriya96@gmail.com>2016-02-25 17:22:11 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-11 22:09:09 -0800
commit6d210eef1b31b02ebec37a2ced6e73a1f94aacf1 (patch)
tree861882e7e79f830d8d0d51ce731cf6db18b84155 /drivers
parentc8843b1f1d134f3e14cd357a74c2d1de52ccf884 (diff)
downloadlinux-6d210eef1b31b02ebec37a2ced6e73a1f94aacf1.tar.bz2
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; ) Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/rdma/hfi1/chip.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c
index 02ba78ff5ca0..46a1830b509b 100644
--- a/drivers/staging/rdma/hfi1/chip.c
+++ b/drivers/staging/rdma/hfi1/chip.c
@@ -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;
}