[PATCH] correct register_hotplug_dock_device() prototype for CONFIG_ACPI_DOCK=n

From: Mikael Pettersson
Date: Tue Aug 23 2011 - 05:28:15 EST


I got the following compiling kernel 3.1-rc3 on x86_64 with CONFIG_ACPI_DOCK=n:

drivers/ata/libata-acpi.c: In function 'ata_acpi_associate':
drivers/ata/libata-acpi.c:266:11: warning: passing argument 2 of 'register_hotplug_dock_device' discards 'const' qualifier from pointer target type [enabled by default]
include/acpi/acpi_drivers.h:146:19: note: expected 'struct acpi_dock_ops *' but argument is of type 'const struct acpi_dock_ops *'
drivers/ata/libata-acpi.c:275:11: warning: passing argument 2 of 'register_hotplug_dock_device' discards 'const' qualifier from pointer target type [enabled by default]
include/acpi/acpi_drivers.h:146:19: note: expected 'struct acpi_dock_ops *' but argument is of type 'const struct acpi_dock_ops *'

The two versions of register_hotplug_dock_device() in acpi_drivers.h,
depending on CONFIG_ACPI_DOCK, differ in whether the 2nd parameter is
const or not. The dummy version for !DOCK lacked the const, causing
the warning. Trivially fixed by adding the const.

Signed-off-by: Mikael Pettersson <mikpe@xxxxxxxx>
---

--- linux-3.1-rc3/include/acpi/acpi_drivers.h.~1~ 2011-08-23 10:42:23.000000000 +0200
+++ linux-3.1-rc3/include/acpi/acpi_drivers.h 2011-08-23 11:06:50.000000000 +0200
@@ -144,7 +144,7 @@ static inline void unregister_dock_notif
{
}
static inline int register_hotplug_dock_device(acpi_handle handle,
- struct acpi_dock_ops *ops,
+ const struct acpi_dock_ops *ops,
void *context)
{
return -ENODEV;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/