Thread (16 messages) 16 messages, 4 authors, 2022-09-08

Re: [PATCH v1 8/8] efi/dev-path-parser: Refactor _UID handling to use acpi_dev_uid_to_integer()

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2022-09-08 10:06:55
Also in: linux-acpi, linux-arm-msm, linux-efi, linux-i2c, linux-spi, lkml

On Thu, Sep 08, 2022 at 10:20:47AM +0200, Ard Biesheuvel wrote:
On Wed, 7 Sept 2022 at 18:57, Andy Shevchenko
[off-list ref] wrote:
...
quoted
        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.
quoted
+               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



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help