From: Yu Watanabe Date: Sun, 24 Dec 2023 15:30:40 +0000 (+0900) Subject: sd-device: shorten code a big X-Git-Tag: v256-rc1~1394^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=54cbad304cca7a588cc6d59d9e62fff757514ebb;p=thirdparty%2Fsystemd.git sd-device: shorten code a big Suggested by coccinelle. --- diff --git a/src/libsystemd/sd-device/device-enumerator.c b/src/libsystemd/sd-device/device-enumerator.c index 15c5c42ade7..11e418e247b 100644 --- a/src/libsystemd/sd-device/device-enumerator.c +++ b/src/libsystemd/sd-device/device-enumerator.c @@ -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; } }