lkml.org 
[lkml]   [2022]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 8/8] efi/dev-path-parser: Refactor _UID handling to use acpi_dev_uid_to_integer()
On Thu, Sep 08, 2022 at 10:20:47AM +0200, Ard Biesheuvel wrote:
> On Wed, 7 Sept 2022 at 18:57, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:

...

> > for_each_acpi_dev_match(adev, hid, NULL, -1) {
> > - if (adev->pnp.unique_id && !strcmp(adev->pnp.unique_id, uid))
> > + ret = acpi_dev_uid_to_integer(adev, &uid);
> > + if (ret == -ENODATA && node->acpi.uid == 0)
> > break;
> > - if (!adev->pnp.unique_id && node->acpi.uid == 0)
> > + if (ret == 0 && node->acpi.uid == uid)
>
> Is it necessary to reorder the conditions here? I.e., why not

Code-wise there should be not much difference which does not affect the flow,
I think I moved it to be closer to the pattern "let's handle errors first",
but in this case I'm fine with your proposal.

> > + ret = acpi_dev_uid_to_integer(adev, &uid);
> > + if (ret == 0 && node->acpi.uid == uid)
> > break;
> > + if (ret == -ENODATA && node->acpi.uid == 0)
> > break;
>
> ?
>
> With that fixed,
>
> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>

Thanks!

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2022-09-08 12:07    [W:0.058 / U:1.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site