Re: [PATCH v2 1/1] platform/x86: asus-wireless: Replace open coded acpi_match_device()
From: Andy Shevchenko
Date: Fri Oct 06 2023 - 11:51:14 EST
On Fri, Oct 06, 2023 at 05:32:10PM +0200, Hans de Goede wrote:
> On 10/6/23 17:27, Andy Shevchenko wrote:
> > + id = acpi_match_device(device_ids, adev);
> > + if (id)
> > + data->hswc_params = (const struct hswc_params *)id->driver_data;
> > if (!data->hswc_params)
> > return 0;
>
> Thanks, but the error checking looks a bit weird now. How about:
>
> id = acpi_match_device(device_ids, adev);
> if (!id)
> return 0;
>
> data->hswc_params = (const struct hswc_params *)id->driver_data;
>
> That seems to better convey what the code's intention is.
Indeed, otherwise the hswc_params seems to stay NULL anyway (due to kzalloc()
use). I'll send a v3 with your suggestion being incorporated, thank you!
--
With Best Regards,
Andy Shevchenko