sd-boot, udev: trivial condition simplifications
Reported and proposed by @dcb314. Fixes #7656 and #7657.
This commit is contained in:
parent
aabe647d20
commit
977f65f01d
|
@ -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_ALT_PRESSED, 0, 'f'):
|
||||||
case KEYPRESS(EFI_CONTROL_PRESSED, SCAN_RIGHT, 0):
|
case KEYPRESS(EFI_CONTROL_PRESSED, SCAN_RIGHT, 0):
|
||||||
/* forward-word */
|
/* forward-word */
|
||||||
while (line[first + cursor] && line[first + cursor] == ' ')
|
while (line[first + cursor] == ' ')
|
||||||
cursor_right(&cursor, &first, x_max, len);
|
cursor_right(&cursor, &first, x_max, len);
|
||||||
while (line[first + cursor] && line[first + cursor] != ' ')
|
while (line[first + cursor] && line[first + cursor] != ' ')
|
||||||
cursor_right(&cursor, &first, x_max, len);
|
cursor_right(&cursor, &first, x_max, len);
|
||||||
|
|
|
@ -547,7 +547,7 @@ static int names_ccw(struct udev_device *dev, struct netnames *names) {
|
||||||
* verify each bus-ID part...
|
* verify each bus-ID part...
|
||||||
*/
|
*/
|
||||||
bus_id_len = strlen(bus_id);
|
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;
|
return -EINVAL;
|
||||||
|
|
||||||
/* Strip leading zeros from the bus id for aesthetic purposes. This
|
/* Strip leading zeros from the bus id for aesthetic purposes. This
|
||||||
|
|
Loading…
Reference in New Issue