mirror of
https://github.com/systemd/systemd
synced 2024-10-02 22:37:25 +00:00
sd-device: shorten code a big
Suggested by coccinelle.
This commit is contained in:
parent
902279f0e4
commit
54cbad304c
|
@ -662,10 +662,8 @@ static int enumerator_add_parent_devices(
|
|||
continue;
|
||||
|
||||
r = device_enumerator_add_device(enumerator, device);
|
||||
if (r < 0)
|
||||
if (r <= 0) /* r == 0 means the device already exists, then no need to go further up. */
|
||||
return r;
|
||||
if (r == 0) /* Exists already? Then no need to go further up. */
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue