Re: [PATCH v2 1/1] platform/x86: asus-wireless: Replace open coded acpi_match_device()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux