diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-07-25 15:22:30 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-07-25 15:22:30 +0200 |
commit | f51bc3904efe69f69f474d9922fe0ffd3fdc16ff (patch) | |
tree | 70147e52dea102e1b03f04d7c3e3ee4073cdbf72 /libmachdev | |
parent | 9def89e999478f2800a0e6ec33fab1dc9d18b659 (diff) | |
download | hurd-f51bc3904efe69f69f474d9922fe0ffd3fdc16ff.tar.gz hurd-f51bc3904efe69f69f474d9922fe0ffd3fdc16ff.tar.bz2 hurd-f51bc3904efe69f69f474d9922fe0ffd3fdc16ff.zip |
libmachdev: simplify source code
* libmachdev/trivfs_server.c (machdev_is_master_device): Simplify source
code.
Diffstat (limited to 'libmachdev')
-rw-r--r-- | libmachdev/trivfs_server.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/libmachdev/trivfs_server.c b/libmachdev/trivfs_server.c index 93d498ad..eec8585e 100644 --- a/libmachdev/trivfs_server.c +++ b/libmachdev/trivfs_server.c @@ -98,27 +98,16 @@ machdev_is_master_device (mach_port_t port) trivfs_protid_class); struct port_info *pi1 = ports_lookup_port (port_bucket, port, trivfs_cntl_class); - if (pi0 == NULL) - { - if (pi1 == NULL) - { - return FALSE; - } - else - { - ports_port_deref (pi1); - return TRUE; - } - } - else - { - ports_port_deref (pi0); + boolean_t ret; - if (pi1 != NULL) - ports_port_deref (pi1); + ret = pi0 != NULL || pi1 != NULL; - return TRUE; - } + if (pi0 != NULL) + ports_port_deref (pi0); + if (pi1 != NULL) + ports_port_deref (pi1); + + return ret; } error_t |