2007-08-05 19:06:23

by Richard Knutsson

[permalink] [raw]
Subject: [PATCH] sonypi: Fix initialization warning

Signed-off-by: Richard Knutsson <[email protected]>
---
Got this from the compiler (gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-13)):
drivers/char/sonypi.c:1153: warning: initialization from incompatible pointer type


diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index 73037a4..2dcd519 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -1147,10 +1147,15 @@ static int sonypi_acpi_remove(struct acpi_device *device, int type)
return 0;
}

+static const struct acpi_device_id sonypi_acpi_driver_ids[] = {
+ {ACPI_PROCESSOR_HID, 0},
+ {"", 0},
+};
+
static struct acpi_driver sonypi_acpi_driver = {
.name = "sonypi",
.class = "hkey",
- .ids = "SNY6001",
+ .ids = sonypi_acpi_driver_ids,
.ops = {
.add = sonypi_acpi_add,
.remove = sonypi_acpi_remove,



2007-08-05 19:49:57

by Thomas Renninger

[permalink] [raw]
Subject: Re: [PATCH] sonypi: Fix initialization warning

On Sun, 2007-08-05 at 21:05 +0200, Richard Knutsson wrote:
> Signed-off-by: Richard Knutsson <[email protected]>
> ---
> Got this from the compiler (gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-13)):
> drivers/char/sonypi.c:1153: warning: initialization from incompatible pointer type
>
>
> diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
> index 73037a4..2dcd519 100644
> --- a/drivers/char/sonypi.c
> +++ b/drivers/char/sonypi.c
> @@ -1147,10 +1147,15 @@ static int sonypi_acpi_remove(struct acpi_device *device, int type)
> return 0;
> }
>
> +static const struct acpi_device_id sonypi_acpi_driver_ids[] = {
> + {ACPI_PROCESSOR_HID, 0},
This is wrong. You need to take the HID the driver should match for, in
this case: {"SNY6001", 0 },

> + {"", 0},
> +};
> +
> static struct acpi_driver sonypi_acpi_driver = {
> .name = "sonypi",
> .class = "hkey",
> - .ids = "SNY6001",
> + .ids = sonypi_acpi_driver_ids,
> .ops = {
> .add = sonypi_acpi_add,
> .remove = sonypi_acpi_remove,

A patch from Eugene Teo fixing this is already on the list of Len's
patches.
See subject: [PATCH 04/12] sonypi: fix ids member of struct acpi_driver
posted yesterday on linux-acpi.
Anyway, thanks for the heads up,

Thomas

2007-08-05 20:03:45

by Richard Knutsson

[permalink] [raw]
Subject: Re: [PATCH] sonypi: Fix initialization warning

Thomas Renninger wrote:
> On Sun, 2007-08-05 at 21:05 +0200, Richard Knutsson wrote:
>
>> Signed-off-by: Richard Knutsson <[email protected]>
>> ---
>> Got this from the compiler (gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-13)):
>> drivers/char/sonypi.c:1153: warning: initialization from incompatible pointer type
>>
>>
>> diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
>> index 73037a4..2dcd519 100644
>> --- a/drivers/char/sonypi.c
>> +++ b/drivers/char/sonypi.c
>> @@ -1147,10 +1147,15 @@ static int sonypi_acpi_remove(struct acpi_device *device, int type)
>> return 0;
>> }
>>
>> +static const struct acpi_device_id sonypi_acpi_driver_ids[] = {
>> + {ACPI_PROCESSOR_HID, 0},
>>
> This is wrong. You need to take the HID the driver should match for, in
> this case: {"SNY6001", 0 },
>
Oh bugger, a cut 'n' paste error...
Thanks for reviewing it.

2007-08-07 19:08:00

by Len Brown

[permalink] [raw]
Subject: Re: [PATCH] sonypi: Fix initialization warning

On Sunday 05 August 2007 16:03, Richard Knutsson wrote:
> Thomas Renninger wrote:
> > On Sun, 2007-08-05 at 21:05 +0200, Richard Knutsson wrote:
> >
> >> Signed-off-by: Richard Knutsson <[email protected]>
> >> ---
> >> Got this from the compiler (gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-13)):
> >> drivers/char/sonypi.c:1153: warning: initialization from incompatible pointer type
> >>
> >>
> >> diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
> >> index 73037a4..2dcd519 100644
> >> --- a/drivers/char/sonypi.c
> >> +++ b/drivers/char/sonypi.c
> >> @@ -1147,10 +1147,15 @@ static int sonypi_acpi_remove(struct acpi_device *device, int type)
> >> return 0;
> >> }
> >>
> >> +static const struct acpi_device_id sonypi_acpi_driver_ids[] = {
> >> + {ACPI_PROCESSOR_HID, 0},
> >>
> > This is wrong. You need to take the HID the driver should match for, in
> > this case: {"SNY6001", 0 },
> >

like this?

http://git.kernel.org/?p=linux/kernel/git/lenb/linux-acpi-2.6.git;a=commitdiff;h=f7b88ccb63188e775fe02e746c39ed177741cfc7;hp=11604ecf6fb9c2ab0152fbddb7ea2724438ef76e

http://marc.info/?l=linux-acpi&m=118618043526395&w=2

2007-08-08 07:21:00

by Thomas Renninger

[permalink] [raw]
Subject: Re: [PATCH] sonypi: Fix initialization warning

On Tue, 2007-08-07 at 15:07 -0400, Len Brown wrote:
> On Sunday 05 August 2007 16:03, Richard Knutsson wrote:
> > Thomas Renninger wrote:
> > > On Sun, 2007-08-05 at 21:05 +0200, Richard Knutsson wrote:
> > >
> > >> Signed-off-by: Richard Knutsson <[email protected]>
> > >> ---
> > >> Got this from the compiler (gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-13)):
> > >> drivers/char/sonypi.c:1153: warning: initialization from incompatible pointer type
> > >>
> > >>
> > >> diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
> > >> index 73037a4..2dcd519 100644
> > >> --- a/drivers/char/sonypi.c
> > >> +++ b/drivers/char/sonypi.c
> > >> @@ -1147,10 +1147,15 @@ static int sonypi_acpi_remove(struct acpi_device *device, int type)
> > >> return 0;
> > >> }
> > >>
> > >> +static const struct acpi_device_id sonypi_acpi_driver_ids[] = {
> > >> + {ACPI_PROCESSOR_HID, 0},
> > >>
> > > This is wrong. You need to take the HID the driver should match for, in
> > > this case: {"SNY6001", 0 },
> > >
>
> like this?
>
> http://git.kernel.org/?p=linux/kernel/git/lenb/linux-acpi-2.6.git;a=commitdiff;h=f7b88ccb63188e775fe02e746c39ed177741cfc7;hp=11604ecf6fb9c2ab0152fbddb7ea2724438ef76e
>
> http://marc.info/?l=linux-acpi&m=118618043526395&w=2

Yes.

Thanks,

Thomas