mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c8843b1f1d
commit
6d210eef1b
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user