[ardb:for-kernelci 3/4] arch/x86/platform/efi/efi_64.c:810:31: error: assignment to 'efi_status_t efi_char16_t const efi_guid_t u32, long unsigned int, void {aka 'long unsigned int short unsigned int const struct <anonymous> unsigned int, l...
by kernel test robot
tree: git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git for-kernelci
head: 5d3ec29ac0d7f5b733d85148f225bf06d6ba42ec
commit: 0c97e87b7a27b4d331c3ecba955e5e08a5b708ec [3/4] efi: use const* paramaters for get/setvar by-ref arguments annotated as IN
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?id...
git remote add ardb git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git
git fetch --no-tags ardb for-kernelci
git checkout 0c97e87b7a27b4d331c3ecba955e5e08a5b708ec
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/x86/platform/efi/efi_64.c: In function 'efi_thunk_get_variable':
arch/x86/platform/efi/efi_64.c:592:60: warning: passing argument 1 of 'efi_name_size' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
592 | phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
| ^~~~
arch/x86/platform/efi/efi_64.c:570:50: note: expected 'efi_char16_t *' {aka 'short unsigned int *'} but argument is of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
570 | static unsigned long efi_name_size(efi_char16_t *name)
| ~~~~~~~~~~~~~~^~~~
arch/x86/platform/efi/efi_64.c:592:40: warning: passing argument 1 of 'virt_to_phys_or_null_size' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
592 | phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
| ^~~~
arch/x86/platform/efi/efi_64.c:155:33: note: expected 'void *' but argument is of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
155 | virt_to_phys_or_null_size(void *va, unsigned long size)
| ~~~~~~^~
arch/x86/platform/efi/efi_64.c: In function 'efi_thunk_set_variable':
arch/x86/platform/efi/efi_64.c:621:60: warning: passing argument 1 of 'efi_name_size' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
621 | phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
| ^~~~
arch/x86/platform/efi/efi_64.c:570:50: note: expected 'efi_char16_t *' {aka 'short unsigned int *'} but argument is of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
570 | static unsigned long efi_name_size(efi_char16_t *name)
| ~~~~~~~~~~~~~~^~~~
arch/x86/platform/efi/efi_64.c:621:40: warning: passing argument 1 of 'virt_to_phys_or_null_size' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
621 | phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
| ^~~~
arch/x86/platform/efi/efi_64.c:155:33: note: expected 'void *' but argument is of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
155 | virt_to_phys_or_null_size(void *va, unsigned long size)
| ~~~~~~^~
arch/x86/platform/efi/efi_64.c: In function 'efi_thunk_runtime_setup':
>> arch/x86/platform/efi/efi_64.c:810:31: error: assignment to 'efi_status_t (*)(const efi_char16_t *, const efi_guid_t *, u32, long unsigned int, void *)' {aka 'long unsigned int (*)(const short unsigned int *, const struct <anonymous> *, unsigned int, long unsigned int, void *)'} from incompatible pointer type 'efi_status_t (*)(efi_char16_t *, efi_guid_t *, u32, long unsigned int, void *)' {aka 'long unsigned int (*)(short unsigned int *, struct <anonymous> *, unsigned int, long unsigned int, void *)'} [-Werror=incompatible-pointer-types]
810 | efi.set_variable_nonblocking = efi_thunk_set_variable_nonblocking;
| ^
cc1: some warnings being treated as errors
vim +810 arch/x86/platform/efi/efi_64.c
4f9dbcfc40299d Matt Fleming 2014-01-10 797
ea5e1919b44f09 Ard Biesheuvel 2020-01-03 798 void __init efi_thunk_runtime_setup(void)
4f9dbcfc40299d Matt Fleming 2014-01-10 799 {
ea5e1919b44f09 Ard Biesheuvel 2020-01-03 800 if (!IS_ENABLED(CONFIG_EFI_MIXED))
ea5e1919b44f09 Ard Biesheuvel 2020-01-03 801 return;
ea5e1919b44f09 Ard Biesheuvel 2020-01-03 802
4f9dbcfc40299d Matt Fleming 2014-01-10 803 efi.get_time = efi_thunk_get_time;
4f9dbcfc40299d Matt Fleming 2014-01-10 804 efi.set_time = efi_thunk_set_time;
4f9dbcfc40299d Matt Fleming 2014-01-10 805 efi.get_wakeup_time = efi_thunk_get_wakeup_time;
4f9dbcfc40299d Matt Fleming 2014-01-10 806 efi.set_wakeup_time = efi_thunk_set_wakeup_time;
4f9dbcfc40299d Matt Fleming 2014-01-10 807 efi.get_variable = efi_thunk_get_variable;
4f9dbcfc40299d Matt Fleming 2014-01-10 808 efi.get_next_variable = efi_thunk_get_next_variable;
4f9dbcfc40299d Matt Fleming 2014-01-10 809 efi.set_variable = efi_thunk_set_variable;
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 @810 efi.set_variable_nonblocking = efi_thunk_set_variable_nonblocking;
4f9dbcfc40299d Matt Fleming 2014-01-10 811 efi.get_next_high_mono_count = efi_thunk_get_next_high_mono_count;
4f9dbcfc40299d Matt Fleming 2014-01-10 812 efi.reset_system = efi_thunk_reset_system;
4f9dbcfc40299d Matt Fleming 2014-01-10 813 efi.query_variable_info = efi_thunk_query_variable_info;
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 814 efi.query_variable_info_nonblocking = efi_thunk_query_variable_info_nonblocking;
4f9dbcfc40299d Matt Fleming 2014-01-10 815 efi.update_capsule = efi_thunk_update_capsule;
4f9dbcfc40299d Matt Fleming 2014-01-10 816 efi.query_capsule_caps = efi_thunk_query_capsule_caps;
4f9dbcfc40299d Matt Fleming 2014-01-10 817 }
69829470457344 Ard Biesheuvel 2020-01-03 818
:::::: The code at line 810 was first introduced by commit
:::::: 83a0a2ea0b991927e42984be220329e776ce7137 efi/x86: Prevent reentrant firmware calls in mixed mode
:::::: TO: Ard Biesheuvel <ard.biesheuvel(a)linaro.org>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH v2 3/3] iio: adc: add ADC driver for the TI TSC2046 controller
by kernel test robot
Hi Oleksij,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linux/master]
[also build test WARNING on linus/master v5.12-rc2]
[cannot apply to iio/togreg]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Oleksij-Rempel/mainline-ti-tsc20...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a74e6a014c9d4d4161061f770c9b4f98372ac778
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
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
# https://github.com/0day-ci/linux/commit/7c34f2cd7f0176071b53152c6065f6d5a...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Oleksij-Rempel/mainline-ti-tsc2046-adc-driver/20210312-185657
git checkout 7c34f2cd7f0176071b53152c6065f6d5a078463b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/device.h:15,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from include/linux/cacheinfo.h:6,
from arch/riscv/include/asm/cacheinfo.h:9,
from arch/riscv/include/asm/elf.h:14,
from include/linux/elf.h:6,
from include/linux/module.h:18,
from drivers/iio/adc/ti-tsc2046.c:10:
drivers/iio/adc/ti-tsc2046.c: In function 'tsc2046_adc_parse_fwnode':
>> drivers/iio/adc/ti-tsc2046.c:579:17: warning: format '%i' expects argument of type 'int', but argument 5 has type 'long unsigned int' [-Wformat=]
579 | dev_err(dev, "%pfw: Unsupported reg value: %i, max supported is: %i.\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/iio/adc/ti-tsc2046.c:579:4: note: in expansion of macro 'dev_err'
579 | dev_err(dev, "%pfw: Unsupported reg value: %i, max supported is: %i.\n",
| ^~~~~~~
drivers/iio/adc/ti-tsc2046.c:579:70: note: format string is defined here
579 | dev_err(dev, "%pfw: Unsupported reg value: %i, max supported is: %i.\n",
| ~^
| |
| int
| %li
vim +579 drivers/iio/adc/ti-tsc2046.c
561
562 static void tsc2046_adc_parse_fwnode(struct tsc2046_adc_priv *priv)
563 {
564 struct fwnode_handle *child;
565 struct device *dev = &priv->spi->dev;
566
567 device_for_each_child_node(dev, child) {
568 u32 stl, aver, reg;
569 int ret;
570
571 ret = fwnode_property_read_u32(child, "reg", ®);
572 if (ret) {
573 dev_err(dev, "invalid reg on %pfw, err: %pe\n", child,
574 ERR_PTR(ret));
575 continue;
576 }
577
578 if (reg >= ARRAY_SIZE(priv->ch_cfg)) {
> 579 dev_err(dev, "%pfw: Unsupported reg value: %i, max supported is: %i.\n",
580 child, reg, ARRAY_SIZE(priv->ch_cfg));
581 continue;
582 }
583
584 ret = fwnode_property_read_u32(child, "settling-time-us", &stl);
585 if (!ret)
586 priv->ch_cfg[reg].settling_time_us = stl;
587
588 ret = fwnode_property_read_u32(child, "average-samples", &aver);
589 if (!ret)
590 priv->ch_cfg[reg].average_samples = aver;
591 }
592 }
593
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[efi:next 3/4] arch/x86/platform/efi/efi_64.c:163:23: warning: passing argument 1 of 'virt_to_phys' discards 'const' qualifier from pointer target type
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
head: 23efbcdb197f07d67f7dcac9037fdf9972b88d9b
commit: 71703d1e1b51e986ad5be41594328d5afa902672 [3/4] efi: use const* paramaters for get/setvar by-ref arguments annotated as IN
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?id=71...
git remote add efi https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
git fetch --no-tags efi next
git checkout 71703d1e1b51e986ad5be41594328d5afa902672
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
arch/x86/platform/efi/efi_64.c: In function 'virt_to_phys_or_null_size':
>> arch/x86/platform/efi/efi_64.c:163:23: warning: passing argument 1 of 'virt_to_phys' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
163 | return virt_to_phys(va);
| ^~
In file included from arch/x86/include/asm/dma.h:13,
from include/linux/memblock.h:14,
from arch/x86/platform/efi/efi_64.c:26:
arch/x86/include/asm/io.h:129:55: note: expected 'volatile void *' but argument is of type 'const void *'
129 | static inline phys_addr_t virt_to_phys(volatile void *address)
| ~~~~~~~~~~~~~~~^~~~~~~
>> arch/x86/platform/efi/efi_64.c:165:25: warning: passing argument 1 of 'slow_virt_to_phys' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
165 | pa = slow_virt_to_phys(va);
| ^~
In file included from arch/x86/include/asm/paravirt_types.h:44,
from arch/x86/include/asm/ptrace.h:94,
from arch/x86/include/asm/math_emu.h:5,
from arch/x86/include/asm/processor.h:13,
from arch/x86/include/asm/cpufeature.h:5,
from arch/x86/include/asm/thread_info.h:53,
from include/linux/thread_info.h:58,
from arch/x86/include/asm/preempt.h:7,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from arch/x86/platform/efi/efi_64.c:23:
arch/x86/include/asm/pgtable_types.h:569:44: note: expected 'void *' but argument is of type 'const void *'
569 | extern phys_addr_t slow_virt_to_phys(void *__address);
| ~~~~~~^~~~~~~~~
arch/x86/platform/efi/efi_64.c: In function 'efi_thunk_get_variable':
arch/x86/platform/efi/efi_64.c:592:60: warning: passing argument 1 of 'efi_name_size' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
592 | phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
| ^~~~
arch/x86/platform/efi/efi_64.c:570:50: note: expected 'efi_char16_t *' {aka 'short unsigned int *'} but argument is of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
570 | static unsigned long efi_name_size(efi_char16_t *name)
| ~~~~~~~~~~~~~~^~~~
arch/x86/platform/efi/efi_64.c: In function 'efi_thunk_set_variable':
arch/x86/platform/efi/efi_64.c:621:60: warning: passing argument 1 of 'efi_name_size' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
621 | phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
| ^~~~
arch/x86/platform/efi/efi_64.c:570:50: note: expected 'efi_char16_t *' {aka 'short unsigned int *'} but argument is of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
570 | static unsigned long efi_name_size(efi_char16_t *name)
| ~~~~~~~~~~~~~~^~~~
arch/x86/platform/efi/efi_64.c: In function 'efi_thunk_set_variable_nonblocking':
arch/x86/platform/efi/efi_64.c:653:60: warning: passing argument 1 of 'efi_name_size' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
653 | phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
| ^~~~
arch/x86/platform/efi/efi_64.c:570:50: note: expected 'efi_char16_t *' {aka 'short unsigned int *'} but argument is of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
570 | static unsigned long efi_name_size(efi_char16_t *name)
| ~~~~~~~~~~~~~~^~~~
vim +163 arch/x86/platform/efi/efi_64.c
d2f7cbe7b26a74 Borislav Petkov 2013-10-31 150
f6697df36bdf0b Matt Fleming 2016-11-12 151 /*
f6697df36bdf0b Matt Fleming 2016-11-12 152 * Wrapper for slow_virt_to_phys() that handles NULL addresses.
f6697df36bdf0b Matt Fleming 2016-11-12 153 */
f6697df36bdf0b Matt Fleming 2016-11-12 154 static inline phys_addr_t
71703d1e1b51e9 Ard Biesheuvel 2021-03-12 155 virt_to_phys_or_null_size(const void *va, unsigned long size)
f6697df36bdf0b Matt Fleming 2016-11-12 156 {
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 157 phys_addr_t pa;
f6697df36bdf0b Matt Fleming 2016-11-12 158
f6697df36bdf0b Matt Fleming 2016-11-12 159 if (!va)
f6697df36bdf0b Matt Fleming 2016-11-12 160 return 0;
f6697df36bdf0b Matt Fleming 2016-11-12 161
f6697df36bdf0b Matt Fleming 2016-11-12 162 if (virt_addr_valid(va))
f6697df36bdf0b Matt Fleming 2016-11-12 @163 return virt_to_phys(va);
f6697df36bdf0b Matt Fleming 2016-11-12 164
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 @165 pa = slow_virt_to_phys(va);
f6697df36bdf0b Matt Fleming 2016-11-12 166
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 167 /* check if the object crosses a page boundary */
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 168 if (WARN_ON((pa ^ (pa + size - 1)) & PAGE_MASK))
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 169 return 0;
f6697df36bdf0b Matt Fleming 2016-11-12 170
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 171 return pa;
f6697df36bdf0b Matt Fleming 2016-11-12 172 }
f6697df36bdf0b Matt Fleming 2016-11-12 173
:::::: The code at line 163 was first introduced by commit
:::::: f6697df36bdf0bf7fce984605c2918d4a7b4269f x86/efi: Prevent mixed mode boot corruption with CONFIG_VMAP_STACK=y
:::::: TO: Matt Fleming <matt(a)codeblueprint.co.uk>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[ardb:for-kernelci 3/4] arch/x86/platform/efi/efi_64.c:592:60: error: passing 'const efi_char16_t (aka 'const unsigned short to parameter of type 'efi_char16_t (aka 'unsigned short discards qualifiers
by kernel test robot
tree: git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git for-kernelci
head: 5d3ec29ac0d7f5b733d85148f225bf06d6ba42ec
commit: 0c97e87b7a27b4d331c3ecba955e5e08a5b708ec [3/4] efi: use const* paramaters for get/setvar by-ref arguments annotated as IN
config: x86_64-randconfig-r001-20210312 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 7b153b43d3a14d76975039408c4b922beb576735)
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/ardb/linux.git/commit/?id...
git remote add ardb git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git
git fetch --no-tags ardb for-kernelci
git checkout 0c97e87b7a27b4d331c3ecba955e5e08a5b708ec
# 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(a)intel.com>
All errors (new ones prefixed by >>):
>> arch/x86/platform/efi/efi_64.c:592:60: error: passing 'const efi_char16_t *' (aka 'const unsigned short *') to parameter of type 'efi_char16_t *' (aka 'unsigned short *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
^~~~
arch/x86/platform/efi/efi_64.c:570:50: note: passing argument to parameter 'name' here
static unsigned long efi_name_size(efi_char16_t *name)
^
>> arch/x86/platform/efi/efi_64.c:592:40: error: passing 'const efi_char16_t *' (aka 'const unsigned short *') to parameter of type 'void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
^~~~
arch/x86/platform/efi/efi_64.c:155:33: note: passing argument to parameter 'va' here
virt_to_phys_or_null_size(void *va, unsigned long size)
^
arch/x86/platform/efi/efi_64.c:621:60: error: passing 'const efi_char16_t *' (aka 'const unsigned short *') to parameter of type 'efi_char16_t *' (aka 'unsigned short *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
^~~~
arch/x86/platform/efi/efi_64.c:570:50: note: passing argument to parameter 'name' here
static unsigned long efi_name_size(efi_char16_t *name)
^
arch/x86/platform/efi/efi_64.c:621:40: error: passing 'const efi_char16_t *' (aka 'const unsigned short *') to parameter of type 'void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
^~~~
arch/x86/platform/efi/efi_64.c:155:33: note: passing argument to parameter 'va' here
virt_to_phys_or_null_size(void *va, unsigned long size)
^
>> arch/x86/platform/efi/efi_64.c:810:31: error: incompatible function pointer types assigning to 'efi_set_variable_t *' (aka 'unsigned long (*)(const unsigned short *, const guid_t *, unsigned int, unsigned long, void *)') from 'efi_status_t (efi_char16_t *, efi_guid_t *, u32, unsigned long, void *)' (aka 'unsigned long (unsigned short *, guid_t *, unsigned int, unsigned long, void *)') [-Werror,-Wincompatible-function-pointer-types]
efi.set_variable_nonblocking = efi_thunk_set_variable_nonblocking;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 errors generated.
vim +592 arch/x86/platform/efi/efi_64.c
4f9dbcfc40299d Matt Fleming 2014-01-10 574
4f9dbcfc40299d Matt Fleming 2014-01-10 575 static efi_status_t
0c97e87b7a27b4 Ard Biesheuvel 2021-03-12 576 efi_thunk_get_variable(const efi_char16_t *name, const efi_guid_t *vendor,
4f9dbcfc40299d Matt Fleming 2014-01-10 577 u32 *attr, unsigned long *data_size, void *data)
4f9dbcfc40299d Matt Fleming 2014-01-10 578 {
63056e8b5ebf41 Ard Biesheuvel 2020-02-21 579 u8 buf[24] __aligned(8);
63056e8b5ebf41 Ard Biesheuvel 2020-02-21 580 efi_guid_t *vnd = PTR_ALIGN((efi_guid_t *)buf, sizeof(*vnd));
4f9dbcfc40299d Matt Fleming 2014-01-10 581 efi_status_t status;
4f9dbcfc40299d Matt Fleming 2014-01-10 582 u32 phys_name, phys_vendor, phys_attr;
4f9dbcfc40299d Matt Fleming 2014-01-10 583 u32 phys_data_size, phys_data;
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 584 unsigned long flags;
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 585
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 586 spin_lock_irqsave(&efi_runtime_lock, flags);
4f9dbcfc40299d Matt Fleming 2014-01-10 587
63056e8b5ebf41 Ard Biesheuvel 2020-02-21 588 *vnd = *vendor;
63056e8b5ebf41 Ard Biesheuvel 2020-02-21 589
f6697df36bdf0b Matt Fleming 2016-11-12 590 phys_data_size = virt_to_phys_or_null(data_size);
63056e8b5ebf41 Ard Biesheuvel 2020-02-21 591 phys_vendor = virt_to_phys_or_null(vnd);
f6697df36bdf0b Matt Fleming 2016-11-12 @592 phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
f6697df36bdf0b Matt Fleming 2016-11-12 593 phys_attr = virt_to_phys_or_null(attr);
f6697df36bdf0b Matt Fleming 2016-11-12 594 phys_data = virt_to_phys_or_null_size(data, *data_size);
4f9dbcfc40299d Matt Fleming 2014-01-10 595
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 596 if (!phys_name || (data && !phys_data))
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 597 status = EFI_INVALID_PARAMETER;
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 598 else
4f9dbcfc40299d Matt Fleming 2014-01-10 599 status = efi_thunk(get_variable, phys_name, phys_vendor,
4f9dbcfc40299d Matt Fleming 2014-01-10 600 phys_attr, phys_data_size, phys_data);
4f9dbcfc40299d Matt Fleming 2014-01-10 601
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 602 spin_unlock_irqrestore(&efi_runtime_lock, flags);
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 603
4f9dbcfc40299d Matt Fleming 2014-01-10 604 return status;
4f9dbcfc40299d Matt Fleming 2014-01-10 605 }
4f9dbcfc40299d Matt Fleming 2014-01-10 606
:::::: The code at line 592 was first introduced by commit
:::::: f6697df36bdf0bf7fce984605c2918d4a7b4269f x86/efi: Prevent mixed mode boot corruption with CONFIG_VMAP_STACK=y
:::::: TO: Matt Fleming <matt(a)codeblueprint.co.uk>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[ardb:for-kernelci 3/4] arch/x86/platform/efi/efi_64.c:592:60: warning: passing argument 1 of 'efi_name_size' discards 'const' qualifier from pointer target type
by kernel test robot
tree: git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git for-kernelci
head: 5d3ec29ac0d7f5b733d85148f225bf06d6ba42ec
commit: 0c97e87b7a27b4d331c3ecba955e5e08a5b708ec [3/4] efi: use const* paramaters for get/setvar by-ref arguments annotated as IN
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?id...
git remote add ardb git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git
git fetch --no-tags ardb for-kernelci
git checkout 0c97e87b7a27b4d331c3ecba955e5e08a5b708ec
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
arch/x86/platform/efi/efi_64.c: In function 'efi_thunk_get_variable':
>> arch/x86/platform/efi/efi_64.c:592:60: warning: passing argument 1 of 'efi_name_size' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
592 | phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
| ^~~~
arch/x86/platform/efi/efi_64.c:570:50: note: expected 'efi_char16_t *' {aka 'short unsigned int *'} but argument is of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
570 | static unsigned long efi_name_size(efi_char16_t *name)
| ~~~~~~~~~~~~~~^~~~
>> arch/x86/platform/efi/efi_64.c:592:40: warning: passing argument 1 of 'virt_to_phys_or_null_size' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
592 | phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
| ^~~~
arch/x86/platform/efi/efi_64.c:155:33: note: expected 'void *' but argument is of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
155 | virt_to_phys_or_null_size(void *va, unsigned long size)
| ~~~~~~^~
arch/x86/platform/efi/efi_64.c: In function 'efi_thunk_set_variable':
arch/x86/platform/efi/efi_64.c:621:60: warning: passing argument 1 of 'efi_name_size' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
621 | phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
| ^~~~
arch/x86/platform/efi/efi_64.c:570:50: note: expected 'efi_char16_t *' {aka 'short unsigned int *'} but argument is of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
570 | static unsigned long efi_name_size(efi_char16_t *name)
| ~~~~~~~~~~~~~~^~~~
arch/x86/platform/efi/efi_64.c:621:40: warning: passing argument 1 of 'virt_to_phys_or_null_size' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
621 | phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
| ^~~~
arch/x86/platform/efi/efi_64.c:155:33: note: expected 'void *' but argument is of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
155 | virt_to_phys_or_null_size(void *va, unsigned long size)
| ~~~~~~^~
arch/x86/platform/efi/efi_64.c: In function 'efi_thunk_runtime_setup':
arch/x86/platform/efi/efi_64.c:810:31: error: assignment to 'efi_status_t (*)(const efi_char16_t *, const efi_guid_t *, u32, long unsigned int, void *)' {aka 'long unsigned int (*)(const short unsigned int *, const struct <anonymous> *, unsigned int, long unsigned int, void *)'} from incompatible pointer type 'efi_status_t (*)(efi_char16_t *, efi_guid_t *, u32, long unsigned int, void *)' {aka 'long unsigned int (*)(short unsigned int *, struct <anonymous> *, unsigned int, long unsigned int, void *)'} [-Werror=incompatible-pointer-types]
810 | efi.set_variable_nonblocking = efi_thunk_set_variable_nonblocking;
| ^
cc1: some warnings being treated as errors
vim +592 arch/x86/platform/efi/efi_64.c
4f9dbcfc40299d Matt Fleming 2014-01-10 574
4f9dbcfc40299d Matt Fleming 2014-01-10 575 static efi_status_t
0c97e87b7a27b4 Ard Biesheuvel 2021-03-12 576 efi_thunk_get_variable(const efi_char16_t *name, const efi_guid_t *vendor,
4f9dbcfc40299d Matt Fleming 2014-01-10 577 u32 *attr, unsigned long *data_size, void *data)
4f9dbcfc40299d Matt Fleming 2014-01-10 578 {
63056e8b5ebf41 Ard Biesheuvel 2020-02-21 579 u8 buf[24] __aligned(8);
63056e8b5ebf41 Ard Biesheuvel 2020-02-21 580 efi_guid_t *vnd = PTR_ALIGN((efi_guid_t *)buf, sizeof(*vnd));
4f9dbcfc40299d Matt Fleming 2014-01-10 581 efi_status_t status;
4f9dbcfc40299d Matt Fleming 2014-01-10 582 u32 phys_name, phys_vendor, phys_attr;
4f9dbcfc40299d Matt Fleming 2014-01-10 583 u32 phys_data_size, phys_data;
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 584 unsigned long flags;
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 585
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 586 spin_lock_irqsave(&efi_runtime_lock, flags);
4f9dbcfc40299d Matt Fleming 2014-01-10 587
63056e8b5ebf41 Ard Biesheuvel 2020-02-21 588 *vnd = *vendor;
63056e8b5ebf41 Ard Biesheuvel 2020-02-21 589
f6697df36bdf0b Matt Fleming 2016-11-12 590 phys_data_size = virt_to_phys_or_null(data_size);
63056e8b5ebf41 Ard Biesheuvel 2020-02-21 591 phys_vendor = virt_to_phys_or_null(vnd);
f6697df36bdf0b Matt Fleming 2016-11-12 @592 phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
f6697df36bdf0b Matt Fleming 2016-11-12 593 phys_attr = virt_to_phys_or_null(attr);
f6697df36bdf0b Matt Fleming 2016-11-12 594 phys_data = virt_to_phys_or_null_size(data, *data_size);
4f9dbcfc40299d Matt Fleming 2014-01-10 595
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 596 if (!phys_name || (data && !phys_data))
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 597 status = EFI_INVALID_PARAMETER;
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 598 else
4f9dbcfc40299d Matt Fleming 2014-01-10 599 status = efi_thunk(get_variable, phys_name, phys_vendor,
4f9dbcfc40299d Matt Fleming 2014-01-10 600 phys_attr, phys_data_size, phys_data);
4f9dbcfc40299d Matt Fleming 2014-01-10 601
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 602 spin_unlock_irqrestore(&efi_runtime_lock, flags);
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 603
4f9dbcfc40299d Matt Fleming 2014-01-10 604 return status;
4f9dbcfc40299d Matt Fleming 2014-01-10 605 }
4f9dbcfc40299d Matt Fleming 2014-01-10 606
:::::: The code at line 592 was first introduced by commit
:::::: f6697df36bdf0bf7fce984605c2918d4a7b4269f x86/efi: Prevent mixed mode boot corruption with CONFIG_VMAP_STACK=y
:::::: TO: Matt Fleming <matt(a)codeblueprint.co.uk>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
drivers/block/paride/bpck.c:32: warning: "PC" redefined
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f78d76e72a4671ea52d12752d92077788b4f5d50
commit: 4ef873226ceb9c7bf11a922caddc5698a24bcfaf mm: introduce fault_signal_pending()
date: 11 months ago
config: mips-randconfig-r033-20210312 (attached as .config)
compiler: mips64-linux-gcc (GCC) 9.3.0
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
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 4ef873226ceb9c7bf11a922caddc5698a24bcfaf
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/block/paride/bpck.c:32: warning: "PC" redefined
32 | #define PC pi->private
|
In file included from arch/mips/include/asm/ptrace.h:19,
from include/linux/sched/signal.h:14,
from include/linux/rcuwait.h:6,
from include/linux/percpu-rwsem.h:7,
from include/linux/fs.h:34,
from arch/mips/include/asm/elf.h:12,
from include/linux/elf.h:5,
from include/linux/module.h:18,
from drivers/block/paride/bpck.c:19:
arch/mips/include/uapi/asm/ptrace.h:17: note: this is the location of the previous definition
17 | #define PC 64
|
vim +/PC +32 drivers/block/paride/bpck.c
^1da177e4c3f415 Linus Torvalds 2005-04-16 31
^1da177e4c3f415 Linus Torvalds 2005-04-16 @32 #define PC pi->private
^1da177e4c3f415 Linus Torvalds 2005-04-16 33 #define r2() (PC=(in_p(2) & 0xff))
^1da177e4c3f415 Linus Torvalds 2005-04-16 34 #define w2(byte) {out_p(2,byte); PC = byte;}
^1da177e4c3f415 Linus Torvalds 2005-04-16 35 #define t2(pat) {PC ^= pat; out_p(2,PC);}
^1da177e4c3f415 Linus Torvalds 2005-04-16 36 #define e2() {PC &= 0xfe; out_p(2,PC);}
^1da177e4c3f415 Linus Torvalds 2005-04-16 37 #define o2() {PC |= 1; out_p(2,PC);}
^1da177e4c3f415 Linus Torvalds 2005-04-16 38
:::::: The code at line 32 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds(a)ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds(a)ppc970.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months