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