From: Hans de Goede <hdegoede@redhat.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Linux PM <linux-pm@vger.kernel.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: Re: [PATCH RESEND 1/2] ACPI: platform-profile: Drop const qualifier for cur_profile
Date: Thu, 14 Jan 2021 14:54:29 +0100 [thread overview]
Message-ID: <00166b14-d9aa-fd0d-99b1-4a93151f1cf3@redhat.com> (raw)
In-Reply-To: <CAJZ5v0i=bFw7WJA615UyLXnZ4kgK4E+0ZB=Ykgge+o3+9onnPA@mail.gmail.com>
Hi,
On 1/14/21 1:16 PM, Rafael J. Wysocki wrote:
> On Thu, Jan 14, 2021 at 8:42 AM Jiaxun Yang <jiaxun.yang@flygoat.com> wrote:
>>
>> All planned uses of cur_profile have their platform_profile_handler
>> defined as const, so just drop const qualifier here to prevent build
>> error.
>>
>> Link: https://lore.kernel.org/linux-acpi/5e7a4d87-52ef-e487-9cc2-8e7094beaa08@redhat.com/
>> Suggested-by: Hans de Goede <hdegoede@redhat.com>
>> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>> ---
>> drivers/acpi/platform_profile.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
>> index 91be50a32cc8..9dddf44b43d4 100644
>> --- a/drivers/acpi/platform_profile.c
>> +++ b/drivers/acpi/platform_profile.c
>> @@ -9,7 +9,7 @@
>> #include <linux/platform_profile.h>
>> #include <linux/sysfs.h>
>>
>> -static const struct platform_profile_handler *cur_profile;
>> +static struct platform_profile_handler *cur_profile;
>
> I think that it's not just here, but also in the
> platform_profile_register() argument.
Correct, this needs to be fixed in platform_profile_register() too,
both in drivers/acpi/platform_profile.c and in
include/linux/platform_profile.h
Otherwise we will get a compiler warning (or maybe even an error)
about assigning a pointer pointing to const memory to a pointer not
pointing to const mem.
Regards,
Hans
>
>> static DEFINE_MUTEX(profile_lock);
>>
>> static const char * const profile_names[] = {
>> --
>> 2.30.0
>>
>
next prev parent reply other threads:[~2021-01-14 13:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-14 7:34 [PATCH RESEND 0/2] ACPI: platform-profile enhancements Jiaxun Yang
2021-01-14 7:34 ` [PATCH RESEND 1/2] ACPI: platform-profile: Drop const qualifier for cur_profile Jiaxun Yang
2021-01-14 12:16 ` Rafael J. Wysocki
2021-01-14 13:54 ` Hans de Goede [this message]
2021-01-14 7:34 ` [PATCH RESEND 2/2] ACPI: platform-profile: Introduce object pointers to callbacks Jiaxun Yang
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=00166b14-d9aa-fd0d-99b1-4a93151f1cf3@redhat.com \
--to=hdegoede@redhat.com \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@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).