Skip to contentSkip to conversation

drivers/firmware/efi/earlycon.c:33:10: warning: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int'

PATCH Nick Desaulniers 3 participants 3 messages Dec 5, 2019 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

+ Andy, looks legit. should be return 0.

Quoted 59 lines · kbuild test robot

CC: kbuild-all(a)lists.01.org
CC: linux-efi(a)vger.kernel.org
TO: Andy Shevchenko <[email protected]>
CC: Ard Biesheuvel <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git urgent
head:   93afe6258b5ae6bd32981f5249f7b0c1a32cde01
commit: 93afe6258b5ae6bd32981f5249f7b0c1a32cde01 [6/6] efi/earlycon: Remap entire framebuffer after page initialization
config: arm64-defconfig (attached as .config)
compiler: clang version 10.0.0 (git://gitmirror/llvm_project d6cbc9528d46d30416a6f9cd6c8570b704a0bd33)

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
git checkout 93afe6258b5ae6bd32981f5249f7b0c1a32cde01
# save the attached .config to linux build tree
make.cross ARCH=arm64

If you fix the issue, kindly add following tag

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

drivers/firmware/efi/earlycon.c:33:10: warning: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion]

                   return NULL;
                          ^~~~
   include/linux/stddef.h:8:14: note: expanded from macro 'NULL'
   #define NULL ((void *)0)
                ^~~~~~~~~~~

1 warning generated.

vim +33 drivers/firmware/efi/earlycon.c

22
23 /*
24 * efi earlycon needs to use early_memremap() to map the framebuffer.
25 * But early_memremap() is not usable for 'earlycon=efifb keep_bootcon',
26 * memremap() should be used instead. memremap() will be available after
27 * paging_init() which is earlier than initcall callbacks. Thus adding this
28 * early initcall function early_efi_map_fb() to map the whole efi framebuffer.
29 */
30 static int __init early_efi_map_fb(void)
31 {
32 if (!fb_base || !fb_size)

Quoted 1 line

33 return NULL;

    34
    35          if (pgprot_val(fb_prot) == pgprot_val(PAGE_KERNEL))
    36                  efi_fb = memremap(fb_base, fb_size, MEMREMAP_WB);
    37          else
    38                  efi_fb = memremap(fb_base, fb_size, MEMREMAP_WC);
    39
    40          return efi_fb ? 0 : -ENOMEM;
    41  }
    42  early_initcall(early_efi_map_fb);
    43

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

Signature · 2 lines
Thanks,
~Nick Desaulniers
#2 lore raw
Quoted 1 line · Nick Desaulniers

+ Andy, looks legit. should be return 0.

Thanks, Ard promised to fix this.
Dunno what happen here.

Quoted 66 lines · kbuild test robot
Quoted 59 lines

CC: kbuild-all(a)lists.01.org
CC: linux-efi(a)vger.kernel.org
TO: Andy Shevchenko <[email protected]>
CC: Ard Biesheuvel <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git urgent
head:   93afe6258b5ae6bd32981f5249f7b0c1a32cde01
commit: 93afe6258b5ae6bd32981f5249f7b0c1a32cde01 [6/6] efi/earlycon: Remap entire framebuffer after page initialization
config: arm64-defconfig (attached as .config)
compiler: clang version 10.0.0 (git://gitmirror/llvm_project d6cbc9528d46d30416a6f9cd6c8570b704a0bd33)

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
git checkout 93afe6258b5ae6bd32981f5249f7b0c1a32cde01
# save the attached .config to linux build tree
make.cross ARCH=arm64

If you fix the issue, kindly add following tag

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

drivers/firmware/efi/earlycon.c:33:10: warning: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion]

                   return NULL;
                          ^~~~
   include/linux/stddef.h:8:14: note: expanded from macro 'NULL'
   #define NULL ((void *)0)
                ^~~~~~~~~~~

1 warning generated.

vim +33 drivers/firmware/efi/earlycon.c

22
23 /*
24 * efi earlycon needs to use early_memremap() to map the framebuffer.
25 * But early_memremap() is not usable for 'earlycon=efifb keep_bootcon',
26 * memremap() should be used instead. memremap() will be available after
27 * paging_init() which is earlier than initcall callbacks. Thus adding this
28 * early initcall function early_efi_map_fb() to map the whole efi framebuffer.
29 */
30 static int __init early_efi_map_fb(void)
31 {
32 if (!fb_base || !fb_size)

Quoted 1 line

33 return NULL;

    34
    35          if (pgprot_val(fb_prot) == pgprot_val(PAGE_KERNEL))
    36                  efi_fb = memremap(fb_base, fb_size, MEMREMAP_WB);
    37          else
    38                  efi_fb = memremap(fb_base, fb_size, MEMREMAP_WC);
    39
    40          return efi_fb ? 0 : -ENOMEM;
    41  }
    42  early_initcall(early_efi_map_fb);
    43

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

Signature · 2 lines
Thanks,
~Nick Desaulniers
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
Quoted 7 lines · Andy Shevchenko
Quoted 1 line · Nick Desaulniers

+ Andy, looks legit. should be return 0.

Thanks, Ard promised to fix this.
Dunno what happen here.

Yeah, this is outdated already, and fixed in the latest version.

Quoted 72 lines
Quoted 63 lines · kbuild test robot
Quoted 56 lines

CC: kbuild-all(a)lists.01.org
CC: linux-efi(a)vger.kernel.org
TO: Andy Shevchenko <[email protected]>
CC: Ard Biesheuvel <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git urgent
head:   93afe6258b5ae6bd32981f5249f7b0c1a32cde01
commit: 93afe6258b5ae6bd32981f5249f7b0c1a32cde01 [6/6] efi/earlycon: Remap entire framebuffer after page initialization
config: arm64-defconfig (attached as .config)
compiler: clang version 10.0.0 (git://gitmirror/llvm_project d6cbc9528d46d30416a6f9cd6c8570b704a0bd33)

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
git checkout 93afe6258b5ae6bd32981f5249f7b0c1a32cde01
# save the attached .config to linux build tree
make.cross ARCH=arm64

If you fix the issue, kindly add following tag

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

drivers/firmware/efi/earlycon.c:33:10: warning: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion]

                   return NULL;
                          ^~~~
   include/linux/stddef.h:8:14: note: expanded from macro 'NULL'
   #define NULL ((void *)0)
                ^~~~~~~~~~~

1 warning generated.

vim +33 drivers/firmware/efi/earlycon.c

22
23 /*
24 * efi earlycon needs to use early_memremap() to map the framebuffer.
25 * But early_memremap() is not usable for 'earlycon=efifb keep_bootcon',
26 * memremap() should be used instead. memremap() will be available after
27 * paging_init() which is earlier than initcall callbacks. Thus adding this
28 * early initcall function early_efi_map_fb() to map the whole efi framebuffer.
29 */
30 static int __init early_efi_map_fb(void)
31 {
32 if (!fb_base || !fb_size)

Quoted 1 line

33 return NULL;

    34
    35          if (pgprot_val(fb_prot) == pgprot_val(PAGE_KERNEL))
    36                  efi_fb = memremap(fb_base, fb_size, MEMREMAP_WB);
    37          else
    38                  efi_fb = memremap(fb_base, fb_size, MEMREMAP_WC);
    39
    40          return efi_fb ? 0 : -ENOMEM;
    41  }
    42  early_initcall(early_efi_map_fb);
    43
Quoted 3 lines

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

Quoted 3 lines

--
Thanks,
~Nick Desaulniers

--
With Best Regards,
Andy Shevchenko