From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Semen Protsenko <semen.protsenko@linaro.org>
Cc: Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] acpi: respect const qualifier
Date: Mon, 21 Apr 2014 22:44:59 +0200 [thread overview]
Message-ID: <3334700.hi79274ifW@vostro.rjw.lan> (raw)
In-Reply-To: <1397750006-17463-1-git-send-email-semen.protsenko@linaro.org>
On Thursday, April 17, 2014 06:53:26 PM Semen Protsenko wrote:
> 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 --------------------------------->
This is not a mainline kernel problem, surely?
>
> 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);
> }
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2014-04-21 20:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-17 15:53 Semen Protsenko
2014-04-21 20:44 ` Rafael J. Wysocki [this message]
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=3334700.hi79274ifW@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=semen.protsenko@linaro.org \
/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
all inboxes | Powered by JetHome®