projects
/
rtos
/
tinyara.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0034699
)
net/netdev: simplify netdev_findbyname()
author
Heesub Shin
<heesub.shin@samsung.com>
Thu, 18 May 2017 07:30:13 +0000
(16:30 +0900)
committer
Heesub Shin
<heesub.shin@samsung.com>
Tue, 23 May 2017 12:40:05 +0000
(21:40 +0900)
This commit simplifies internal logic of netdev_findbyname() for better
readability.
Change-Id: Ice458a799fd708a127bbb705f99be1eb692caed2
Signed-off-by: Heesub Shin <heesub.shin@samsung.com>
os/net/netdev/netdev_findbyname.c
patch
|
blob
|
history
diff --git
a/os/net/netdev/netdev_findbyname.c
b/os/net/netdev/netdev_findbyname.c
index
9750b72
..
8acb2bb
100644
(file)
--- a/
os/net/netdev/netdev_findbyname.c
+++ b/
os/net/netdev/netdev_findbyname.c
@@
-112,14
+112,9
@@
FAR struct netif *netdev_findbyname(const char *ifname)
if (ifname) {
netdev_semtake();
dev = netif_find((char *)ifname);
+ netdev_semgive();
- if (NULL != dev) {
- netdev_semgive();
- return dev;
- } else {
- netdev_semgive();
- return NULL;
- }
+ return dev;
}
return NULL;