projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b583faf
)
IB/hfi1: Remove anti-pattern in cdev init
author
Dennis Dalessandro
<
[email protected]
>
Thu, 19 May 2016 12:22:03 +0000
(
05:22
-0700)
committer
Doug Ledford
<
[email protected]
>
Thu, 26 May 2016 15:23:11 +0000
(11:23 -0400)
Remove the usage of an anti-pattern goto in hfi1_cdev_init to improve
code readability.
Suggested-by: Jason Gunthorpe <
[email protected]
>
Reviewed-by: Ira Weiny <
[email protected]
>
Signed-off-by: Dennis Dalessandro <
[email protected]
>
Signed-off-by: Doug Ledford <
[email protected]
>
drivers/staging/rdma/hfi1/device.c
patch
|
blob
|
history
diff --git
a/drivers/staging/rdma/hfi1/device.c
b/drivers/staging/rdma/hfi1/device.c
index c05c39da83b1087796d79d4194e944fd7fabc63c..6ee800f0359f768418b835e517473471a428fc96 100644
(file)
--- a/
drivers/staging/rdma/hfi1/device.c
+++ b/
drivers/staging/rdma/hfi1/device.c
@@
-82,13
+82,13
@@
int hfi1_cdev_init(int minor, const char *name,
else
device = device_create(class, NULL, dev, NULL, "%s", name);
- if (
!IS_ERR(device))
-
goto done
;
-
ret = PTR_ERR(device)
;
- device = NULL;
- pr_err("Could not create device for minor %d, %s (err %d)\n",
-
minor, name, -ret
);
- cdev_del(cdev);
+ if (
IS_ERR(device)) {
+
ret = PTR_ERR(device)
;
+
device = NULL
;
+ pr_err("Could not create device for minor %d, %s (err %d)\n",
+ minor, name, -ret);
+
cdev_del(cdev
);
+ }
done:
*devp = device;
return ret;