[Toybox] [PATCH] Correct a condition to evaluate scan_uevent() result

enh enh at google.com
Thu Mar 3 16:27:59 PST 2022


(oops... didn't see that changyeonjo had created a github pull request
already --- this is his same change, just via a different route.)

On Thu, Mar 3, 2022 at 4:23 PM enh <enh at google.com> wrote:

> Fix: 222572616
> Test: adb root && adb shell lsusb
> ---
>
> diff --git a/toys/other/lsusb.c b/toys/other/lsusb.c
> index 8d2aa13..cbe8091 100644
> --- a/toys/other/lsusb.c
> +++ b/toys/other/lsusb.c
> @@ -161,7 +161,7 @@
>    char *n1, *n2;
>
>    if (!new->parent) return DIRTREE_RECURSE;
> -  if (3 != scan_uevent(new, 3, (struct scanloop[]){{"BUSNUM=%u", &busnum,
> 0},
> +  if (3 == scan_uevent(new, 3, (struct scanloop[]){{"BUSNUM=%u", &busnum,
> 0},
>      {"DEVNUM=%u", &devnum, 0}, {"PRODUCT=%x/%x", &pid, &vid}}))
>    {
>      get_names(TT.ids, pid, vid, &n1, &n2);
> @@ -203,7 +203,7 @@
>    }
>
>    // Load uevent data, look up names in database
> -  if (3 != scan_uevent(new, 3, (struct scanloop[]){{"DRIVER=", &driver,
> 0},
> +  if (3 == scan_uevent(new, 3, (struct scanloop[]){{"DRIVER=", &driver,
> 0},
>      {"PCI_CLASS=%x", cvd, 0}, {"PCI_ID=%x:%x", cvd+1, cvd+2}})) return 0;
>    get_names(TT.class, 255&(cvd[0]>>16), 255&(cvd[0]>>8), names, names);
>    get_names(TT.ids, cvd[1], cvd[2], names+1, names+2);
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20220303/f676dcd4/attachment.html>


More information about the Toybox mailing list