* [pm:bleeding-edge 20/29] drivers/acpi/platform_profile.c:67:33: error: passing 'const struct platform_profile_handler to parameter of type 'struct platform_profile_handler discards qualifiers
@ 2021-01-08 8:52 kernel test robot
2021-01-12 10:42 ` Hans de Goede
0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2021-01-08 8:52 UTC (permalink / raw)
To: Jiaxun Yang
Cc: kbuild-all, clang-built-linux, linux-acpi, devel, linux-pm,
Rafael J. Wysocki, Hans de Goede
[-- Attachment #1: Type: text/plain, Size: 3061 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge
head: 2691096b51bae3563007c4b0188c3eec9878224b
commit: b417d9c7404df67b9be0104585fefb2ca8d36677 [20/29] ACPI: platform-profile: Pass profile pointer to driver callbacks
config: x86_64-randconfig-r011-20210108 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 5c951623bc8965fa1e89660f2f5f4a2944e4981a)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?id=b417d9c7404df67b9be0104585fefb2ca8d36677
git remote add pm https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
git fetch --no-tags pm bleeding-edge
git checkout b417d9c7404df67b9be0104585fefb2ca8d36677
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> drivers/acpi/platform_profile.c:67:33: error: passing 'const struct platform_profile_handler *' to parameter of type 'struct platform_profile_handler *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
err = cur_profile->profile_get(cur_profile, &profile);
^~~~~~~~~~~
drivers/acpi/platform_profile.c:107:33: error: passing 'const struct platform_profile_handler *' to parameter of type 'struct platform_profile_handler *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
err = cur_profile->profile_set(cur_profile, i);
^~~~~~~~~~~
2 errors generated.
vim +67 drivers/acpi/platform_profile.c
50
51 static ssize_t platform_profile_show(struct device *dev,
52 struct device_attribute *attr,
53 char *buf)
54 {
55 enum platform_profile_option profile = PLATFORM_PROFILE_BALANCED;
56 int err;
57
58 err = mutex_lock_interruptible(&profile_lock);
59 if (err)
60 return err;
61
62 if (!cur_profile) {
63 mutex_unlock(&profile_lock);
64 return -ENODEV;
65 }
66
> 67 err = cur_profile->profile_get(cur_profile, &profile);
68 mutex_unlock(&profile_lock);
69 if (err)
70 return err;
71
72 /* Check that profile is valid index */
73 if (WARN_ON((profile < 0) || (profile >= ARRAY_SIZE(profile_names))))
74 return -EIO;
75
76 return sysfs_emit(buf, "%s\n", profile_names[profile]);
77 }
78
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36224 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [pm:bleeding-edge 20/29] drivers/acpi/platform_profile.c:67:33: error: passing 'const struct platform_profile_handler to parameter of type 'struct platform_profile_handler discards qualifiers
2021-01-08 8:52 [pm:bleeding-edge 20/29] drivers/acpi/platform_profile.c:67:33: error: passing 'const struct platform_profile_handler to parameter of type 'struct platform_profile_handler discards qualifiers kernel test robot
@ 2021-01-12 10:42 ` Hans de Goede
2021-01-12 12:07 ` Jiaxun Yang
0 siblings, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2021-01-12 10:42 UTC (permalink / raw)
To: kernel test robot, Jiaxun Yang
Cc: kbuild-all, clang-built-linux, linux-acpi, devel, linux-pm,
Rafael J. Wysocki
Hi,
On 1/8/21 9:52 AM, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge
> head: 2691096b51bae3563007c4b0188c3eec9878224b
> commit: b417d9c7404df67b9be0104585fefb2ca8d36677 [20/29] ACPI: platform-profile: Pass profile pointer to driver callbacks
> config: x86_64-randconfig-r011-20210108 (attached as .config)
> compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 5c951623bc8965fa1e89660f2f5f4a2944e4981a)
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # install x86_64 cross compiling tool for clang build
> # apt-get install binutils-x86-64-linux-gnu
> # https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?id=b417d9c7404df67b9be0104585fefb2ca8d36677
> git remote add pm https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
> git fetch --no-tags pm bleeding-edge
> git checkout b417d9c7404df67b9be0104585fefb2ca8d36677
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
>>> drivers/acpi/platform_profile.c:67:33: error: passing 'const struct platform_profile_handler *' to parameter of type 'struct platform_profile_handler *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
> err = cur_profile->profile_get(cur_profile, &profile);
> ^~~~~~~~~~~
> drivers/acpi/platform_profile.c:107:33: error: passing 'const struct platform_profile_handler *' to parameter of type 'struct platform_profile_handler *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
> err = cur_profile->profile_set(cur_profile, i);
> ^~~~~~~~~~~
> 2 errors generated.
Ugh, so that means that the current version of the
"ACPI: platform-profile: Pass profile pointer to driver callbacks"
patch is no good. Since this is causing compile errors I assume
that it will be dropped from the bleeding-edge branch.
Is that right Rafael?
I believe that the best fix is to just drop the const everywhere,
neither of the 2 planned uses has its platform_profile_handler defined
as const:
1. In the thinkpad_acpi case it is not const, because of using set_bit
calls to set the choices bits.
2. In the ideapad-laptop case it is not const because it will be
embedded in the dynamically allocated drv_data struct.
Jiaxun, can you do a new version where you drop the const (and
explain why this is done in the commit message) ?
Regards,
Hans
>
>
> vim +67 drivers/acpi/platform_profile.c
>
> 50
> 51 static ssize_t platform_profile_show(struct device *dev,
> 52 struct device_attribute *attr,
> 53 char *buf)
> 54 {
> 55 enum platform_profile_option profile = PLATFORM_PROFILE_BALANCED;
> 56 int err;
> 57
> 58 err = mutex_lock_interruptible(&profile_lock);
> 59 if (err)
> 60 return err;
> 61
> 62 if (!cur_profile) {
> 63 mutex_unlock(&profile_lock);
> 64 return -ENODEV;
> 65 }
> 66
> > 67 err = cur_profile->profile_get(cur_profile, &profile);
> 68 mutex_unlock(&profile_lock);
> 69 if (err)
> 70 return err;
> 71
> 72 /* Check that profile is valid index */
> 73 if (WARN_ON((profile < 0) || (profile >= ARRAY_SIZE(profile_names))))
> 74 return -EIO;
> 75
> 76 return sysfs_emit(buf, "%s\n", profile_names[profile]);
> 77 }
> 78
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [pm:bleeding-edge 20/29] drivers/acpi/platform_profile.c:67:33: error: passing 'const struct platform_profile_handler to parameter of type 'struct platform_profile_handler discards qualifiers
2021-01-12 10:42 ` Hans de Goede
@ 2021-01-12 12:07 ` Jiaxun Yang
2021-01-12 12:10 ` Hans de Goede
0 siblings, 1 reply; 5+ messages in thread
From: Jiaxun Yang @ 2021-01-12 12:07 UTC (permalink / raw)
To: Hans de Goede, kernel test robot, Rafael J. Wysocki
Cc: kbuild-all, clang-built-linux, linux-acpi, devel, linux-pm
在 2021/1/12 下午6:42, Hans de Goede 写道:
> Hi,
>
> On 1/8/21 9:52 AM, kernel test robot wrote:
[...]
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
[...]
>> 2 errors generated.
Oops, thanks for the reminder, I should exclude 0day CI from mail filter.
It's wired that GCC didn't say anything about it.
> Ugh, so that means that the current version of the
> "ACPI: platform-profile: Pass profile pointer to driver callbacks"
> patch is no good. Since this is causing compile errors I assume
> that it will be dropped from the bleeding-edge branch.
> Is that right Rafael?
I'm not familiar with x86pdx and ACPI workflow.
Should I resend the patch or send a fixup patch?
>
> I believe that the best fix is to just drop the const everywhere,
> neither of the 2 planned uses has its platform_profile_handler defined
> as const:
>
> 1. In the thinkpad_acpi case it is not const, because of using set_bit
> calls to set the choices bits.
>
> 2. In the ideapad-laptop case it is not const because it will be
> embedded in the dynamically allocated drv_data struct.
>
> Jiaxun, can you do a new version where you drop the const (and
> explain why this is done in the commit message) ?
Appreciate for your patient investigation!
>
> Regards,
>
> Hans
[...]
Thanks.
- Jiaxun
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [pm:bleeding-edge 20/29] drivers/acpi/platform_profile.c:67:33: error: passing 'const struct platform_profile_handler to parameter of type 'struct platform_profile_handler discards qualifiers
2021-01-12 12:07 ` Jiaxun Yang
@ 2021-01-12 12:10 ` Hans de Goede
2021-01-12 13:49 ` Rafael J. Wysocki
0 siblings, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2021-01-12 12:10 UTC (permalink / raw)
To: Jiaxun Yang, kernel test robot, Rafael J. Wysocki
Cc: kbuild-all, clang-built-linux, linux-acpi, devel, linux-pm
Hi,
On 1/12/21 1:07 PM, Jiaxun Yang wrote:
> 在 2021/1/12 下午6:42, Hans de Goede 写道:
>> Hi,
>>
>> On 1/8/21 9:52 AM, kernel test robot wrote:
> [...]
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kernel test robot <lkp@intel.com>
>>
>> All errors (new ones prefixed by >>):
>>
> [...]
>>> 2 errors generated.
>
> Oops, thanks for the reminder, I should exclude 0day CI from mail filter.
> It's wired that GCC didn't say anything about it.
>
>> Ugh, so that means that the current version of the
>> "ACPI: platform-profile: Pass profile pointer to driver callbacks"
>> patch is no good. Since this is causing compile errors I assume
>> that it will be dropped from the bleeding-edge branch.
>> Is that right Rafael?
>
> I'm not familiar with x86pdx and ACPI workflow.
> Should I resend the patch or send a fixup patch?
I believe a new version of the patch is best, then Rafael can
replace the broken patch. We want to avoid having a commit in
git history which does not compile in some cases, because that
creates problems when git bisecting.
Regards,
Hans
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [pm:bleeding-edge 20/29] drivers/acpi/platform_profile.c:67:33: error: passing 'const struct platform_profile_handler to parameter of type 'struct platform_profile_handler discards qualifiers
2021-01-12 12:10 ` Hans de Goede
@ 2021-01-12 13:49 ` Rafael J. Wysocki
0 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2021-01-12 13:49 UTC (permalink / raw)
To: Hans de Goede
Cc: Jiaxun Yang, kernel test robot, Rafael J. Wysocki, kbuild-all,
clang-built-linux, ACPI Devel Maling List,
open list:ACPI COMPONENT ARCHITECTURE (ACPICA),
Linux PM
On Tue, Jan 12, 2021 at 1:11 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi,
>
> On 1/12/21 1:07 PM, Jiaxun Yang wrote:
> > 在 2021/1/12 下午6:42, Hans de Goede 写道:
> >> Hi,
> >>
> >> On 1/8/21 9:52 AM, kernel test robot wrote:
> > [...]
> >>
> >> If you fix the issue, kindly add following tag as appropriate
> >> Reported-by: kernel test robot <lkp@intel.com>
> >>
> >> All errors (new ones prefixed by >>):
> >>
> > [...]
> >>> 2 errors generated.
> >
> > Oops, thanks for the reminder, I should exclude 0day CI from mail filter.
> > It's wired that GCC didn't say anything about it.
> >
> >> Ugh, so that means that the current version of the
> >> "ACPI: platform-profile: Pass profile pointer to driver callbacks"
> >> patch is no good. Since this is causing compile errors I assume
> >> that it will be dropped from the bleeding-edge branch.
> >> Is that right Rafael?
> >
> > I'm not familiar with x86pdx and ACPI workflow.
> > Should I resend the patch or send a fixup patch?
>
> I believe a new version of the patch is best, then Rafael can
> replace the broken patch. We want to avoid having a commit in
> git history which does not compile in some cases, because that
> creates problems when git bisecting.
That's right.
If the plan is to drop the "const" everywhere, I would appreciate an
additional patch to do that on top of the two from Mark and a new
patch adding a new callback on top of that.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-01-12 13:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08 8:52 [pm:bleeding-edge 20/29] drivers/acpi/platform_profile.c:67:33: error: passing 'const struct platform_profile_handler to parameter of type 'struct platform_profile_handler discards qualifiers kernel test robot
2021-01-12 10:42 ` Hans de Goede
2021-01-12 12:07 ` Jiaxun Yang
2021-01-12 12:10 ` Hans de Goede
2021-01-12 13:49 ` Rafael J. Wysocki
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).