All of lore.kernel.org
 help / color / mirror / Atom feed
* [arm-integrator:kasan 6/6] mm/kasan/init.c:318:9: warning: variable 'pud' set but not used
@ 2020-10-01 22:25 kernel test robot
  2020-10-02  9:19 ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2020-10-01 22:25 UTC (permalink / raw)
  To: kbuild-all

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

Hi Andrey,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git kasan
head:   fb5e749f76335be35afcb3ea74ad3fa0926900db
commit: fb5e749f76335be35afcb3ea74ad3fa0926900db [6/6] ARM: Enable KASan for ARM
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-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/linusw/linux-integrator.git/commit/?id=fb5e749f76335be35afcb3ea74ad3fa0926900db
        git remote add arm-integrator https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git
        git fetch --no-tags arm-integrator kasan
        git checkout fb5e749f76335be35afcb3ea74ad3fa0926900db
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm 

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

All warnings (new ones prefixed by >>):

   mm/kasan/init.c: In function 'kasan_free_pud':
>> mm/kasan/init.c:318:9: warning: variable 'pud' set but not used [-Wunused-but-set-variable]
     318 |  pud_t *pud;
         |         ^~~

vim +/pud +318 mm/kasan/init.c

0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  315  
0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  316  static void kasan_free_pud(pud_t *pud_start, p4d_t *p4d)
0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  317  {
0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17 @318  	pud_t *pud;
0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  319  	int i;
0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  320  
0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  321  	for (i = 0; i < PTRS_PER_PUD; i++) {
0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  322  		pud = pud_start + i;
0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  323  		if (!pud_none(*pud))
0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  324  			return;
0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  325  	}
0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  326  
0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  327  	pud_free(&init_mm, (pud_t *)page_to_virt(p4d_page(*p4d)));
0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  328  	p4d_clear(p4d);
0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  329  }
0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  330  

:::::: The code@line 318 was first introduced by commit
:::::: 0207df4fa1a869281ddbf72db6203dbf036b3e1a kernel/memremap, kasan: make ZONE_DEVICE with work with KASAN

:::::: TO: Andrey Ryabinin <aryabinin@virtuozzo.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 76106 bytes --]

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

* Re: [arm-integrator:kasan 6/6] mm/kasan/init.c:318:9: warning: variable 'pud' set but not used
  2020-10-01 22:25 [arm-integrator:kasan 6/6] mm/kasan/init.c:318:9: warning: variable 'pud' set but not used kernel test robot
@ 2020-10-02  9:19 ` Linus Walleij
  2020-10-21 15:02   ` Xia, Hui
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2020-10-02  9:19 UTC (permalink / raw)
  To: kbuild-all

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

Help me out on this one.

On Fri, Oct 2, 2020 at 12:26 AM kernel test robot <lkp@intel.com> wrote:

>    mm/kasan/init.c: In function 'kasan_free_pud':
> >> mm/kasan/init.c:318:9: warning: variable 'pud' set but not used [-Wunused-but-set-variable]
>      318 |  pud_t *pud;
>          |         ^~~

Aha

> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  316  static void kasan_free_pud(pud_t *pud_start, p4d_t *p4d)
> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  317  {
> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17 @318    pud_t *pud;

There it is

> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  319    int i;
> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  320
> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  321    for (i = 0; i < PTRS_PER_PUD; i++) {
> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  322            pud = pud_start + i;

There it is set

> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  323            if (!pud_none(*pud))

There it is used

What am I not seeing? I know I can't trust my human brain parser
so I guess I'm wrong.

Yours,
Linus Walleij

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

* Re: [arm-integrator:kasan 6/6] mm/kasan/init.c:318:9: warning: variable 'pud' set but not used
  2020-10-02  9:19 ` Linus Walleij
@ 2020-10-21 15:02   ` Xia, Hui
  0 siblings, 0 replies; 3+ messages in thread
From: Xia, Hui @ 2020-10-21 15:02 UTC (permalink / raw)
  To: kbuild-all

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



>-----Original Message-----
>From: Linus Walleij <linus.walleij@linaro.org>
>Sent: 2020年10月2日 17:19
>To: lkp <lkp@intel.com>
>Cc: Andrey Ryabinin <ryabinin@virtuozzo.com>; kbuild-all(a)lists.01.org; Ard
>Biesheuvel <ardb@kernel.org>; Abbott Liu <liuwenliang@huawei.com>;
>Florian Fainelli <f.fainelli@gmail.com>
>Subject: [kbuild-all] Re: [arm-integrator:kasan 6/6] mm/kasan/init.c:318:9:
>warning: variable 'pud' set but not used
>
>Help me out on this one.
>
>On Fri, Oct 2, 2020 at 12:26 AM kernel test robot <lkp@intel.com> wrote:
>
>>    mm/kasan/init.c: In function 'kasan_free_pud':
>> >> mm/kasan/init.c:318:9: warning: variable 'pud' set but not used
>> >> [-Wunused-but-set-variable]
>>      318 |  pud_t *pud;
>>          |         ^~~
>
>Aha
>
>> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  316
>> static void kasan_free_pud(pud_t *pud_start, p4d_t *p4d)
>> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  317  {
>> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17 @318
>pud_t *pud;
>
>There it is
>
>> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  319
>int i;
>> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  320
>> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  321
>for (i = 0; i < PTRS_PER_PUD; i++) {
>> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  322
>pud = pud_start + i;
>
>There it is set
>
>> 0207df4fa1a869 mm/kasan/kasan_init.c Andrey Ryabinin 2018-08-17  323
>if (!pud_none(*pud))
>
>There it is used
>
>What am I not seeing? I know I can't trust my human brain parser so I guess
>I'm wrong.

It probably because pud_none was not implemented when CONFIG_PGTABLE_LEVELS=2.
Check:
arch/arm/include/asm/pgtable-2level.h:#define pud_none(pud)             (0)
arch/arm/include/asm/pgtable-3level.h:#define pud_none(pud)             (!pud_val(pud))

Regards,
Hui


>
>Yours,
>Linus Walleij
>_______________________________________________
>kbuild-all mailing list -- kbuild-all(a)lists.01.org To unsubscribe send an email to
>kbuild-all-leave(a)lists.01.org

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

end of thread, other threads:[~2020-10-21 15:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-01 22:25 [arm-integrator:kasan 6/6] mm/kasan/init.c:318:9: warning: variable 'pud' set but not used kernel test robot
2020-10-02  9:19 ` Linus Walleij
2020-10-21 15:02   ` Xia, Hui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.