linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Semen Protsenko <semen.protsenko@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>, Len Brown <lenb@kernel.org>
Cc: <linux-acpi@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] acpi: respect const qualifier
Date: Thu, 17 Apr 2014 18:53:26 +0300	[thread overview]
Message-ID: <1397750006-17463-1-git-send-email-semen.protsenko@linaro.org> (raw)

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@linaro.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


             reply	other threads:[~2014-04-17 15:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-17 15:53 Semen Protsenko [this message]
2014-04-21 20:44 ` [PATCH] acpi: respect const qualifier Rafael J. Wysocki
2014-04-25 15:02   ` Sam Protsenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1397750006-17463-1-git-send-email-semen.protsenko@linaro.org \
    --to=semen.protsenko@linaro.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).