lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20051.29353.630250.758016@pilspetsen.it.uu.se>
Date:	Tue, 23 Aug 2011 11:28:09 +0200
From:	Mikael Pettersson <mikpe@...uu.se>
To:	linux-acpi@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] correct register_hotplug_dock_device() prototype for CONFIG_ACPI_DOCK=n

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@...uu.se>
---

--- 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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ