Re: [PATCH 2/2] misc: Add dell-laptop driver

Matthew Garrett
2008-12-02T20:06:25Z

On Tue, Dec 02, 2008 at 11:50:29AM -0800, Andrew Morton wrote:
> > +struct calling_interface_buffer {
> > + u16 class;
> > + u16 select;
> > + volatile u32 input[4];
> > + volatile u32 output[4];
> > +} __attribute__ ((packed));
>
> We have that little __packed helper for this.

Ok. I've switched to that, although the __attribute__ notation seems to
be the dominant form in the kernel right now.

> > +static struct dmi_system_id __initdata dell_device_table[] = {
>
> this can be made const.

Done.

> > + da_num_tokens += tokens;
> > +}
>
> OK. No locking is needed for updates to the global state?

The parse function is called once during module init, before the driver
is registered. On the other hand, that makes me realise that we leak it
if something else fails, so I've fixed that up as well.

> > +#ifdef CONFIG_ACPI
> > + if (acpi_video_backlight_support())
> > + return 0;
> > +#endif
>
> Do we need the ifdefs here? It looks like include/linux/acpi.h tries
> to provide a suitable 0-returning stub?

They're protected by #ifdef CONFIG_ACPI_VIDEO, but it looks like acpi.h
is empty if CONFIG_ACPI isn't set?

> > + dell_backlight_device = NULL;
> > + ret = PTR_ERR(dell_backlight_device);
>
> The above two statements are in the wrong order.

Good catch, thanks.

--
Matthew Garrett | mjg59@srcf.ucam.org