sd-boot, udev: trivial condition simplifications

Reported and proposed by @dcb314.

Fixes #7656 and #7657.
This commit is contained in:
Yu Watanabe 2017-12-25 13:38:49 +09:00 committed by Lennart Poettering
parent aabe647d20
commit 977f65f01d
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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