From: Yu Watanabe Date: Mon, 25 Dec 2017 04:38:49 +0000 (+0900) Subject: sd-boot, udev: trivial condition simplifications X-Git-Tag: v237~178 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=977f65f01dadb501c6bd08990887eca655361e5e;p=thirdparty%2Fsystemd.git sd-boot, udev: trivial condition simplifications Reported and proposed by @dcb314. Fixes #7656 and #7657. --- diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index ea9f39a7e77..06331da2d41 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -166,7 +166,7 @@ static BOOLEAN line_edit(CHAR16 *line_in, CHAR16 **line_out, UINTN x_max, UINTN case KEYPRESS(EFI_ALT_PRESSED, 0, 'f'): case KEYPRESS(EFI_CONTROL_PRESSED, SCAN_RIGHT, 0): /* forward-word */ - while (line[first + cursor] && line[first + cursor] == ' ') + while (line[first + cursor] == ' ') cursor_right(&cursor, &first, x_max, len); while (line[first + cursor] && line[first + cursor] != ' ') cursor_right(&cursor, &first, x_max, len); diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index f3be27fdd03..945585d82a7 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -547,7 +547,7 @@ static int names_ccw(struct udev_device *dev, struct netnames *names) { * verify each bus-ID part... */ bus_id_len = strlen(bus_id); - if (!bus_id_len || bus_id_len < 8 || bus_id_len > 9) + if (!IN_SET(bus_id_len, 8, 9)) return -EINVAL; /* Strip leading zeros from the bus id for aesthetic purposes. This