提交 6d210eef 编写于 作者: B Bhaktipriya Shridhar 提交者: Greg Kroah-Hartman

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: NBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 c8843b1f
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册