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>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 17 Apr 2014 18:53:26 +0300
From:	Semen Protsenko <semen.protsenko@...aro.org>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Len Brown <lenb@...nel.org>
Cc:	<linux-acpi@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] acpi: respect const qualifier

This patch fixes next warning:

<------------------------------- cut here --------------------------------->
drivers/acpi/property.c: In function ‘acpi_free_properties’:
drivers/acpi/property.c:35:2: warning: passing argument 1 of ‘acpi_os_free’
                              discards ‘const’ qualifier from pointer
                              target type [enabled by default]

  ACPI_FREE(adev->properties);
<------------------------------- cut here --------------------------------->

The problem is next:

 - acpi_free_properties() calls ACPI_FREE(), passing "const *"
   parameter to it
 - ACPI_FREE() is macro for acpi_os_free()
 - acpi_os_free() takes "void *" parameter
 - acpi_os_free() calls kfree()
 - but kfree() requires "const void *" parameter

So acpi_os_free() should require "const void *" parameter as well.

Signed-off-by: Semen Protsenko <semen.protsenko@...aro.org>
---
 include/acpi/platform/aclinux.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 93c55ed..c6fa763 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -174,7 +174,7 @@ static inline void *acpi_os_allocate_zeroed(acpi_size size)
 #define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate_zeroed
 #define USE_NATIVE_ALLOCATE_ZEROED
 
-static inline void acpi_os_free(void *memory)
+static inline void acpi_os_free(const void *memory)
 {
 	kfree(memory);
 }
-- 
1.9.1

--
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