linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 10668/10701] include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear'
@ 2020-05-21  9:30 kbuild test robot
  2020-05-21 18:10 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2020-05-21  9:30 UTC (permalink / raw)
  To: Mike Rapoport; +Cc: kbuild-all, Andrew Morton, Linux Memory Management List

[-- Attachment #1: Type: text/plain, Size: 18595 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   fb57b1fabcb28f358901b2df90abd2b48abc1ca8
commit: ef03574dee21524cbdbbf2af29fe06a62610570d [10668/10701] mm: introduce include/linux/pgtable.h
config: parisc-randconfig-r011-20200521 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout ef03574dee21524cbdbbf2af29fe06a62610570d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

In file included from include/linux/pgtable.h:6,
from include/linux/mm.h:95,
from include/linux/pid_namespace.h:7,
from include/linux/ptrace.h:10,
from arch/parisc/kernel/asm-offsets.c:20:
include/linux/pgtable.h: In function 'pte_clear_not_present_full':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro 'set_pte_at'
322 | #define pte_clear(mm, addr, xp)  set_pte_at(mm, addr, xp, __pte(0))
|                                  ^~~~~~~~~~
>> include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear'
203 |  pte_clear(mm, address, ptep);
|  ^~~~~~~~~
include/linux/pgtable.h: In function '__ptep_modify_prot_commit':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
>> include/linux/pgtable.h:646:2: note: in expansion of macro 'set_pte_at'
646 |  set_pte_at(vma->vm_mm, addr, ptep, pte);
|  ^~~~~~~~~~
--
In file included from include/linux/pgtable.h:6,
from include/linux/mm.h:95,
from sound/core/pcm_native.c:8:
include/linux/pgtable.h: In function 'pte_clear_not_present_full':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro 'set_pte_at'
322 | #define pte_clear(mm, addr, xp)  set_pte_at(mm, addr, xp, __pte(0))
|                                  ^~~~~~~~~~
>> include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear'
203 |  pte_clear(mm, address, ptep);
|  ^~~~~~~~~
include/linux/pgtable.h: In function '__ptep_modify_prot_commit':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
>> include/linux/pgtable.h:646:2: note: in expansion of macro 'set_pte_at'
646 |  set_pte_at(vma->vm_mm, addr, ptep, pte);
|  ^~~~~~~~~~
sound/core/pcm_native.c: In function 'constrain_mask_params':
sound/core/pcm_native.c:254:18: warning: variable 'old_mask' set but not used [-Wunused-but-set-variable]
254 |  struct snd_mask old_mask;
|                  ^~~~~~~~
sound/core/pcm_native.c: In function 'constrain_interval_params':
sound/core/pcm_native.c:290:22: warning: variable 'old_interval' set but not used [-Wunused-but-set-variable]
290 |  struct snd_interval old_interval;
|                      ^~~~~~~~~~~~
sound/core/pcm_native.c: In function 'constrain_params_by_rules':
sound/core/pcm_native.c:331:22: warning: variable 'old_interval' set but not used [-Wunused-but-set-variable]
331 |  struct snd_interval old_interval;
|                      ^~~~~~~~~~~~
sound/core/pcm_native.c:330:18: warning: variable 'old_mask' set but not used [-Wunused-but-set-variable]
330 |  struct snd_mask old_mask;
|                  ^~~~~~~~
sound/core/pcm_native.c: In function 'snd_pcm_hw_params_choose':
sound/core/pcm_native.c:615:22: warning: variable 'old_interval' set but not used [-Wunused-but-set-variable]
615 |  struct snd_interval old_interval;
|                      ^~~~~~~~~~~~
sound/core/pcm_native.c:614:18: warning: variable 'old_mask' set but not used [-Wunused-but-set-variable]
614 |  struct snd_mask old_mask;
|                  ^~~~~~~~
--
In file included from include/linux/pgtable.h:6,
from arch/parisc/include/asm/io.h:6,
from include/linux/io.h:13,
from include/linux/irq.h:20,
from include/linux/gpio/driver.h:7,
from include/linux/of_gpio.h:14,
from sound/soc/codecs/ak4118.c:12:
include/linux/pgtable.h: In function 'pte_clear_not_present_full':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro 'set_pte_at'
322 | #define pte_clear(mm, addr, xp)  set_pte_at(mm, addr, xp, __pte(0))
|                                  ^~~~~~~~~~
>> include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear'
203 |  pte_clear(mm, address, ptep);
|  ^~~~~~~~~
include/linux/pgtable.h: In function '__ptep_modify_prot_commit':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
>> include/linux/pgtable.h:646:2: note: in expansion of macro 'set_pte_at'
646 |  set_pte_at(vma->vm_mm, addr, ptep, pte);
|  ^~~~~~~~~~
At top level:
sound/soc/codecs/ak4118.c:407:34: warning: 'ak4118_of_match' defined but not used [-Wunused-const-variable=]
407 | static const struct of_device_id ak4118_of_match[] = {
|                                  ^~~~~~~~~~~~~~~
--
In file included from include/linux/pgtable.h:6,
from arch/parisc/include/asm/io.h:6,
from include/linux/io.h:13,
from include/linux/irq.h:20,
from include/linux/gpio/driver.h:7,
from include/linux/of_gpio.h:14,
from sound/soc/codecs/ak4458.c:13:
include/linux/pgtable.h: In function 'pte_clear_not_present_full':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro 'set_pte_at'
322 | #define pte_clear(mm, addr, xp)  set_pte_at(mm, addr, xp, __pte(0))
|                                  ^~~~~~~~~~
>> include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear'
203 |  pte_clear(mm, address, ptep);
|  ^~~~~~~~~
include/linux/pgtable.h: In function '__ptep_modify_prot_commit':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
>> include/linux/pgtable.h:646:2: note: in expansion of macro 'set_pte_at'
646 |  set_pte_at(vma->vm_mm, addr, ptep, pte);
|  ^~~~~~~~~~
sound/soc/codecs/ak4458.c: In function 'ak4458_set_dai_mute':
sound/soc/codecs/ak4458.c:408:16: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
408 |  int nfs, ndt, ret, reg;
|                ^~~
--
In file included from include/linux/pgtable.h:6,
from arch/parisc/include/asm/io.h:6,
from include/linux/io.h:13,
from include/linux/iopoll.h:14,
from include/linux/regmap.h:20,
from sound/soc/codecs/ak5558.c:13:
include/linux/pgtable.h: In function 'pte_clear_not_present_full':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro 'set_pte_at'
322 | #define pte_clear(mm, addr, xp)  set_pte_at(mm, addr, xp, __pte(0))
|                                  ^~~~~~~~~~
>> include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear'
203 |  pte_clear(mm, address, ptep);
|  ^~~~~~~~~
include/linux/pgtable.h: In function '__ptep_modify_prot_commit':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
>> include/linux/pgtable.h:646:2: note: in expansion of macro 'set_pte_at'
646 |  set_pte_at(vma->vm_mm, addr, ptep, pte);
|  ^~~~~~~~~~
At top level:
sound/soc/codecs/ak5558.c:388:34: warning: 'ak5558_i2c_dt_ids' defined but not used [-Wunused-const-variable=]
388 | static const struct of_device_id ak5558_i2c_dt_ids[] = {
|                                  ^~~~~~~~~~~~~~~~~
--
In file included from include/linux/pgtable.h:6,
from arch/parisc/include/asm/io.h:6,
from include/linux/io.h:13,
from include/linux/iopoll.h:14,
from include/linux/regmap.h:20,
from sound/soc/codecs/alc5623.c:19:
include/linux/pgtable.h: In function 'pte_clear_not_present_full':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro 'set_pte_at'
322 | #define pte_clear(mm, addr, xp)  set_pte_at(mm, addr, xp, __pte(0))
|                                  ^~~~~~~~~~
>> include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear'
203 |  pte_clear(mm, address, ptep);
|  ^~~~~~~~~
include/linux/pgtable.h: In function '__ptep_modify_prot_commit':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
>> include/linux/pgtable.h:646:2: note: in expansion of macro 'set_pte_at'
646 |  set_pte_at(vma->vm_mm, addr, ptep, pte);
|  ^~~~~~~~~~
At top level:
sound/soc/codecs/alc5623.c:1070:34: warning: 'alc5623_of_match' defined but not used [-Wunused-const-variable=]
1070 | static const struct of_device_id alc5623_of_match[] = {
|                                  ^~~~~~~~~~~~~~~~
--
In file included from include/linux/pgtable.h:6,
from arch/parisc/include/asm/io.h:6,
from include/linux/io.h:13,
from include/linux/irq.h:20,
from include/linux/gpio/driver.h:7,
from include/asm-generic/gpio.h:11,
from include/linux/gpio.h:62,
from sound/soc/codecs/cs42l42.c:19:
include/linux/pgtable.h: In function 'pte_clear_not_present_full':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro 'set_pte_at'
322 | #define pte_clear(mm, addr, xp)  set_pte_at(mm, addr, xp, __pte(0))
|                                  ^~~~~~~~~~
>> include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear'
203 |  pte_clear(mm, address, ptep);
|  ^~~~~~~~~
include/linux/pgtable.h: In function '__ptep_modify_prot_commit':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
>> include/linux/pgtable.h:646:2: note: in expansion of macro 'set_pte_at'
646 |  set_pte_at(vma->vm_mm, addr, ptep, pte);
|  ^~~~~~~~~~
sound/soc/codecs/cs42l42.c: In function 'cs42l42_handle_device_data':
sound/soc/codecs/cs42l42.c:1661:12: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
1661 |   if ((val >= CS42L42_BTN_DET_INIT_DBNCE_MIN) &&
|            ^~
sound/soc/codecs/cs42l42.c:1679:12: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
1679 |   if ((val >= CS42L42_BTN_DET_EVENT_DBNCE_MIN) &&
|            ^~
sound/soc/codecs/cs42l42.c:1698:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
1698 |    if ((thresholds[i] >= CS42L42_HS_DET_LEVEL_MIN) &&
|                       ^~
--
In file included from include/linux/pgtable.h:6,
from arch/parisc/include/asm/io.h:6,
from include/linux/io.h:13,
from include/linux/irq.h:20,
from arch/parisc/include/asm/hardirq.h:13,
from include/linux/hardirq.h:9,
from include/linux/interrupt.h:11,
from include/sound/soc.h:18,
from sound/soc/codecs/es7134.c:9:
include/linux/pgtable.h: In function 'pte_clear_not_present_full':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro 'set_pte_at'
322 | #define pte_clear(mm, addr, xp)  set_pte_at(mm, addr, xp, __pte(0))
|                                  ^~~~~~~~~~
>> include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear'
203 |  pte_clear(mm, address, ptep);
|  ^~~~~~~~~
include/linux/pgtable.h: In function '__ptep_modify_prot_commit':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
>> include/linux/pgtable.h:646:2: note: in expansion of macro 'set_pte_at'
646 |  set_pte_at(vma->vm_mm, addr, ptep, pte);
|  ^~~~~~~~~~
At top level:
sound/soc/codecs/es7134.c:264:33: warning: 'es7154_chip' defined but not used [-Wunused-const-variable=]
264 | static const struct es7134_chip es7154_chip = {
|                                 ^~~~~~~~~~~
sound/soc/codecs/es7134.c:186:33: warning: 'es7134_chip' defined but not used [-Wunused-const-variable=]
186 | static const struct es7134_chip es7134_chip = {
|                                 ^~~~~~~~~~~
--
In file included from include/linux/pgtable.h:6,
from arch/parisc/include/asm/io.h:6,
from include/linux/io.h:13,
from include/linux/iopoll.h:14,
from include/linux/regmap.h:20,
from sound/soc/codecs/es8316.c:17:
include/linux/pgtable.h: In function 'pte_clear_not_present_full':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro 'set_pte_at'
322 | #define pte_clear(mm, addr, xp)  set_pte_at(mm, addr, xp, __pte(0))
|                                  ^~~~~~~~~~
>> include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear'
203 |  pte_clear(mm, address, ptep);
|  ^~~~~~~~~
include/linux/pgtable.h: In function '__ptep_modify_prot_commit':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
>> include/linux/pgtable.h:646:2: note: in expansion of macro 'set_pte_at'
646 |  set_pte_at(vma->vm_mm, addr, ptep, pte);
|  ^~~~~~~~~~
At top level:
sound/soc/codecs/es8316.c:842:36: warning: 'es8316_acpi_match' defined but not used [-Wunused-const-variable=]
842 | static const struct acpi_device_id es8316_acpi_match[] = {
|                                    ^~~~~~~~~~~~~~~~~
sound/soc/codecs/es8316.c:836:34: warning: 'es8316_of_match' defined but not used [-Wunused-const-variable=]
836 | static const struct of_device_id es8316_of_match[] = {
|                                  ^~~~~~~~~~~~~~~
--
In file included from include/linux/pgtable.h:6,
from arch/parisc/include/asm/io.h:6,
from include/linux/io.h:13,
from include/linux/iopoll.h:14,
from include/linux/regmap.h:20,
from sound/soc/codecs/pcm1789-i2c.c:11:
include/linux/pgtable.h: In function 'pte_clear_not_present_full':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro 'set_pte_at'
322 | #define pte_clear(mm, addr, xp)  set_pte_at(mm, addr, xp, __pte(0))
|                                  ^~~~~~~~~~
>> include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear'
203 |  pte_clear(mm, address, ptep);
|  ^~~~~~~~~
include/linux/pgtable.h: In function '__ptep_modify_prot_commit':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
>> include/linux/pgtable.h:646:2: note: in expansion of macro 'set_pte_at'
646 |  set_pte_at(vma->vm_mm, addr, ptep, pte);
|  ^~~~~~~~~~
At top level:
sound/soc/codecs/pcm1789-i2c.c:36:34: warning: 'pcm1789_of_match' defined but not used [-Wunused-const-variable=]
36 | static const struct of_device_id pcm1789_of_match[] = {
|                                  ^~~~~~~~~~~~~~~~
..

vim +/pte_clear +203 include/linux/pgtable.h

a600388d284193 include/asm-generic/pgtable.h Zachary Amsden   2005-09-03  191  
9888a1cae3f859 include/asm-generic/pgtable.h Zachary Amsden   2006-09-30  192  /*
9888a1cae3f859 include/asm-generic/pgtable.h Zachary Amsden   2006-09-30  193   * Some architectures may be able to avoid expensive synchronization
9888a1cae3f859 include/asm-generic/pgtable.h Zachary Amsden   2006-09-30  194   * primitives when modifications are made to PTE's which are already
9888a1cae3f859 include/asm-generic/pgtable.h Zachary Amsden   2006-09-30  195   * not present, or in the process of an address space destruction.
9888a1cae3f859 include/asm-generic/pgtable.h Zachary Amsden   2006-09-30  196   */
9888a1cae3f859 include/asm-generic/pgtable.h Zachary Amsden   2006-09-30  197  #ifndef __HAVE_ARCH_PTE_CLEAR_NOT_PRESENT_FULL
e2cda322648122 include/asm-generic/pgtable.h Andrea Arcangeli 2011-01-13  198  static inline void pte_clear_not_present_full(struct mm_struct *mm,
e2cda322648122 include/asm-generic/pgtable.h Andrea Arcangeli 2011-01-13  199  					      unsigned long address,
e2cda322648122 include/asm-generic/pgtable.h Andrea Arcangeli 2011-01-13  200  					      pte_t *ptep,
e2cda322648122 include/asm-generic/pgtable.h Andrea Arcangeli 2011-01-13  201  					      int full)
e2cda322648122 include/asm-generic/pgtable.h Andrea Arcangeli 2011-01-13  202  {
e2cda322648122 include/asm-generic/pgtable.h Andrea Arcangeli 2011-01-13 @203  	pte_clear(mm, address, ptep);
e2cda322648122 include/asm-generic/pgtable.h Andrea Arcangeli 2011-01-13  204  }
a600388d284193 include/asm-generic/pgtable.h Zachary Amsden   2005-09-03  205  #endif
a600388d284193 include/asm-generic/pgtable.h Zachary Amsden   2005-09-03  206  

:::::: The code at line 203 was first introduced by commit
:::::: e2cda322648122dc400c85ada80eaddbc612ef6a thp: add pmd mangling generic functions

:::::: TO: Andrea Arcangeli <aarcange@redhat.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

---
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: 33603 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-next:master 10668/10701] include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear'
  2020-05-21  9:30 [linux-next:master 10668/10701] include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear' kbuild test robot
@ 2020-05-21 18:10 ` Andrew Morton
  2020-05-21 18:58   ` Mike Rapoport
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2020-05-21 18:10 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Mike Rapoport, kbuild-all, Linux Memory Management List,
	James E.J. Bottomley, Helge Deller, linux-parisc

On Thu, 21 May 2020 17:30:52 +0800 kbuild test robot <lkp@intel.com> wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   fb57b1fabcb28f358901b2df90abd2b48abc1ca8
> commit: ef03574dee21524cbdbbf2af29fe06a62610570d [10668/10701] mm: introduce include/linux/pgtable.h
> config: parisc-randconfig-r011-20200521 (attached as .config)
> compiler: hppa-linux-gcc (GCC) 9.3.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         git checkout ef03574dee21524cbdbbf2af29fe06a62610570d
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>, old ones prefixed by <<):
> 
> In file included from include/linux/pgtable.h:6,
> from include/linux/mm.h:95,
> from include/linux/pid_namespace.h:7,
> from include/linux/ptrace.h:10,
> from arch/parisc/kernel/asm-offsets.c:20:
> include/linux/pgtable.h: In function 'pte_clear_not_present_full':
> arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
> 96 |   pte_t old_pte;              |         ^~~~~~~
> arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro 'set_pte_at'
> 322 | #define pte_clear(mm, addr, xp)  set_pte_at(mm, addr, xp, __pte(0))
> |                                  ^~~~~~~~~~
> >> include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear'
> 203 |  pte_clear(mm, address, ptep);
> |  ^~~~~~~~~
> include/linux/pgtable.h: In function '__ptep_modify_prot_commit':
> arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]

I can't reproduce this.  And I can't see anything in -mm whcih would
have triggered this warning.

arch/parisc/include/asm/pgtable.h has

#define set_pte_at(mm, addr, ptep, pteval)			\
	do {							\
		pte_t old_pte;					\
		unsigned long flags;				\
		spin_lock_irqsave(pgd_spinlock((mm)->pgd), flags);\
		old_pte = *ptep;				\
		set_pte(ptep, pteval);				\
		purge_tlb_entries(mm, addr);			\
		spin_unlock_irqrestore(pgd_spinlock((mm)->pgd), flags);\
	} while (0)

and old_pte has been set-but-not-used for a long time.

Obviously we can fix it, but I'm worried that parisc's set_pte_at() was
previously unused and we've now done something to cause it to be used,
so we're now running previously untested code.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-next:master 10668/10701] include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear'
  2020-05-21 18:10 ` Andrew Morton
@ 2020-05-21 18:58   ` Mike Rapoport
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Rapoport @ 2020-05-21 18:58 UTC (permalink / raw)
  To: Andrew Morton
  Cc: kbuild test robot, kbuild-all, Linux Memory Management List,
	James E.J. Bottomley, Helge Deller, linux-parisc

On Thu, May 21, 2020 at 11:10:13AM -0700, Andrew Morton wrote:
> On Thu, 21 May 2020 17:30:52 +0800 kbuild test robot <lkp@intel.com> wrote:
> 
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > head:   fb57b1fabcb28f358901b2df90abd2b48abc1ca8
> > commit: ef03574dee21524cbdbbf2af29fe06a62610570d [10668/10701] mm: introduce include/linux/pgtable.h
> > config: parisc-randconfig-r011-20200521 (attached as .config)
> > compiler: hppa-linux-gcc (GCC) 9.3.0
> > reproduce:
> >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >         chmod +x ~/bin/make.cross
> >         git checkout ef03574dee21524cbdbbf2af29fe06a62610570d
> >         # save the attached .config to linux build tree
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc 
> > 
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kbuild test robot <lkp@intel.com>
> > 
> > All warnings (new ones prefixed by >>, old ones prefixed by <<):
> > 
> > In file included from include/linux/pgtable.h:6,
> > from include/linux/mm.h:95,
> > from include/linux/pid_namespace.h:7,
> > from include/linux/ptrace.h:10,
> > from arch/parisc/kernel/asm-offsets.c:20:
> > include/linux/pgtable.h: In function 'pte_clear_not_present_full':
> > arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
> > 96 |   pte_t old_pte;              |         ^~~~~~~
> > arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro 'set_pte_at'
> > 322 | #define pte_clear(mm, addr, xp)  set_pte_at(mm, addr, xp, __pte(0))
> > |                                  ^~~~~~~~~~
> > >> include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear'
> > 203 |  pte_clear(mm, address, ptep);
> > |  ^~~~~~~~~
> > include/linux/pgtable.h: In function '__ptep_modify_prot_commit':
> > arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
> 
> I can't reproduce this.  And I can't see anything in -mm whcih would
> have triggered this warning.
> 
> arch/parisc/include/asm/pgtable.h has
> 
> #define set_pte_at(mm, addr, ptep, pteval)			\
> 	do {							\
> 		pte_t old_pte;					\
> 		unsigned long flags;				\
> 		spin_lock_irqsave(pgd_spinlock((mm)->pgd), flags);\
> 		old_pte = *ptep;				\
> 		set_pte(ptep, pteval);				\
> 		purge_tlb_entries(mm, addr);			\
> 		spin_unlock_irqrestore(pgd_spinlock((mm)->pgd), flags);\
> 	} while (0)
> 
> and old_pte has been set-but-not-used for a long time.
> 
> Obviously we can fix it, but I'm worried that parisc's set_pte_at() was
> previously unused and we've now done something to cause it to be used,
> so we're now running previously untested code.
 
I can reporduce it with

make W=1 ARCH=parisc CROSS_COMPILE=/opt/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux-

on both the v5.7-rc6 and linux-next.

The only difference in the header names:

--- build-master.log	2020-05-21 21:44:03.064168815 +0300
+++ build-next.log	2020-05-21 21:44:52.372330747 +0300
@@ -2,25 +2,26 @@
   GEN     Makefile
   CALL    scripts/atomic/check-atomics.sh
   CC      arch/parisc/kernel/asm-offsets.s
-In file included from include/linux/mm.h:95,
+In file included from include/linux/pgtable.h:6,
+                 from include/linux/mm.h:31,
                  from include/linux/pid_namespace.h:7,
                  from include/linux/ptrace.h:10,
                  from arch/parisc/kernel/asm-offsets.c:20:
-include/asm-generic/pgtable.h: In function 'pte_clear_not_present_full':
+include/linux/pgtable.h: In function 'pte_clear_not_present_full':
 arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
    pte_t old_pte;     \
          ^~~~~~~
 arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro 'set_pte_at'
  #define pte_clear(mm, addr, xp)  set_pte_at(mm, addr, xp, __pte(0))
                                   ^~~~~~~~~~
...

I think moving asm-generic/pgtable.h to linux/pgtable.h triggered the
"new warning" notification.

And the fix is obviously:

From 6de5f02d11fef8894836168c3e7bede05916d02d Mon Sep 17 00:00:00 2001
From: Mike Rapoport <rppt@linux.ibm.com>
Date: Thu, 21 May 2020 21:49:01 +0300
Subject: [PATCH] parisc: set_pte_at: remove unused old_pte variable.

kbuild test robot complains about unused variable old_pte in set_pte_at()
macro:

arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 |   pte_t old_pte;              |         ^~~~~~~
arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro 'set_pte_at'
322 | #define pte_clear(mm, addr, xp)  set_pte_at(mm, addr, xp, __pte(0))

Remove the old_pte variable.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
 arch/parisc/include/asm/pgtable.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h
index 097d19007f2e..75cf84070fc9 100644
--- a/arch/parisc/include/asm/pgtable.h
+++ b/arch/parisc/include/asm/pgtable.h
@@ -93,10 +93,8 @@ static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr)
 
 #define set_pte_at(mm, addr, ptep, pteval)			\
 	do {							\
-		pte_t old_pte;					\
 		unsigned long flags;				\
 		spin_lock_irqsave(pgd_spinlock((mm)->pgd), flags);\
-		old_pte = *ptep;				\
 		set_pte(ptep, pteval);				\
 		purge_tlb_entries(mm, addr);			\
 		spin_unlock_irqrestore(pgd_spinlock((mm)->pgd), flags);\
-- 
2.26.2


-- 
Sincerely yours,
Mike.


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-21 18:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21  9:30 [linux-next:master 10668/10701] include/linux/pgtable.h:203:2: note: in expansion of macro 'pte_clear' kbuild test robot
2020-05-21 18:10 ` Andrew Morton
2020-05-21 18:58   ` Mike Rapoport

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).