[linux-next:master 8408/10945] include/linux/fortify-string.h:25:29: warning: argument 1 null where non-null expected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   5e63226c72287bc6c6724d4fc7e157af0e3d7908
commit: 8983bfd58d61ab29ab4114089d1f42e1ee6103a8 [8408/10945] platform/x86: lg-laptop: Support for battery charge limit on newer models
config: x86_64-buildonly-randconfig-r001-20210828 (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/next/linux-next.git/commit/?id=8983bfd58d61ab29ab4114089d1f42e1ee6103a8
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 8983bfd58d61ab29ab4114089d1f42e1ee6103a8
        # 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@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   In file included from include/linux/string.h:262,
                    from include/linux/bitmap.h:10,
                    from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/mutex.h:17,
                    from include/linux/kernfs.h:12,
                    from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/of.h:17,
                    from include/linux/irqdomain.h:35,
                    from include/linux/acpi.h:13,
                    from drivers/platform/x86/lg-laptop.c:10:
   In function 'strlen',
       inlined from 'acpi_add' at drivers/platform/x86/lg-laptop.c:644:6,
       inlined from 'acpi_add' at drivers/platform/x86/lg-laptop.c:621:12:
>> include/linux/fortify-string.h:25:29: warning: argument 1 null where non-null expected [-Wnonnull]
      25 | #define __underlying_strlen __builtin_strlen
         |                             ^
   include/linux/fortify-string.h:60:10: note: in expansion of macro '__underlying_strlen'
      60 |   return __underlying_strlen(p);
         |          ^~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/lg-laptop.c: In function 'acpi_add':
   include/linux/fortify-string.h:25:29: note: in a call to built-in function '__builtin_strlen'
      25 | #define __underlying_strlen __builtin_strlen
         |                             ^
   include/linux/fortify-string.h:60:10: note: in expansion of macro '__underlying_strlen'
      60 |   return __underlying_strlen(p);
         |          ^~~~~~~~~~~~~~~~~~~
   In function 'strlen',
       inlined from 'acpi_add' at drivers/platform/x86/lg-laptop.c:660:8,
       inlined from 'acpi_add' at drivers/platform/x86/lg-laptop.c:621:12:
>> include/linux/fortify-string.h:25:29: warning: argument 1 null where non-null expected [-Wnonnull]
      25 | #define __underlying_strlen __builtin_strlen
         |                             ^
   include/linux/fortify-string.h:60:10: note: in expansion of macro '__underlying_strlen'
      60 |   return __underlying_strlen(p);
         |          ^~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/lg-laptop.c: In function 'acpi_add':
   include/linux/fortify-string.h:25:29: note: in a call to built-in function '__builtin_strlen'
      25 | #define __underlying_strlen __builtin_strlen
         |                             ^
   include/linux/fortify-string.h:60:10: note: in expansion of macro '__underlying_strlen'
      60 |   return __underlying_strlen(p);
         |          ^~~~~~~~~~~~~~~~~~~


vim +25 include/linux/fortify-string.h

a28a6e860c6cf2 Francis Laniel 2021-02-25   4  
a28a6e860c6cf2 Francis Laniel 2021-02-25   5  
a28a6e860c6cf2 Francis Laniel 2021-02-25   6  #if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)
a28a6e860c6cf2 Francis Laniel 2021-02-25   7  extern void *__underlying_memchr(const void *p, int c, __kernel_size_t size) __RENAME(memchr);
a28a6e860c6cf2 Francis Laniel 2021-02-25   8  extern int __underlying_memcmp(const void *p, const void *q, __kernel_size_t size) __RENAME(memcmp);
a28a6e860c6cf2 Francis Laniel 2021-02-25   9  extern void *__underlying_memcpy(void *p, const void *q, __kernel_size_t size) __RENAME(memcpy);
a28a6e860c6cf2 Francis Laniel 2021-02-25  10  extern void *__underlying_memmove(void *p, const void *q, __kernel_size_t size) __RENAME(memmove);
a28a6e860c6cf2 Francis Laniel 2021-02-25  11  extern void *__underlying_memset(void *p, int c, __kernel_size_t size) __RENAME(memset);
a28a6e860c6cf2 Francis Laniel 2021-02-25  12  extern char *__underlying_strcat(char *p, const char *q) __RENAME(strcat);
a28a6e860c6cf2 Francis Laniel 2021-02-25  13  extern char *__underlying_strcpy(char *p, const char *q) __RENAME(strcpy);
a28a6e860c6cf2 Francis Laniel 2021-02-25  14  extern __kernel_size_t __underlying_strlen(const char *p) __RENAME(strlen);
a28a6e860c6cf2 Francis Laniel 2021-02-25  15  extern char *__underlying_strncat(char *p, const char *q, __kernel_size_t count) __RENAME(strncat);
a28a6e860c6cf2 Francis Laniel 2021-02-25  16  extern char *__underlying_strncpy(char *p, const char *q, __kernel_size_t size) __RENAME(strncpy);
a28a6e860c6cf2 Francis Laniel 2021-02-25  17  #else
a28a6e860c6cf2 Francis Laniel 2021-02-25  18  #define __underlying_memchr	__builtin_memchr
a28a6e860c6cf2 Francis Laniel 2021-02-25  19  #define __underlying_memcmp	__builtin_memcmp
a28a6e860c6cf2 Francis Laniel 2021-02-25  20  #define __underlying_memcpy	__builtin_memcpy
a28a6e860c6cf2 Francis Laniel 2021-02-25  21  #define __underlying_memmove	__builtin_memmove
a28a6e860c6cf2 Francis Laniel 2021-02-25  22  #define __underlying_memset	__builtin_memset
a28a6e860c6cf2 Francis Laniel 2021-02-25  23  #define __underlying_strcat	__builtin_strcat
a28a6e860c6cf2 Francis Laniel 2021-02-25  24  #define __underlying_strcpy	__builtin_strcpy
a28a6e860c6cf2 Francis Laniel 2021-02-25 @25  #define __underlying_strlen	__builtin_strlen
a28a6e860c6cf2 Francis Laniel 2021-02-25  26  #define __underlying_strncat	__builtin_strncat
a28a6e860c6cf2 Francis Laniel 2021-02-25  27  #define __underlying_strncpy	__builtin_strncpy
a28a6e860c6cf2 Francis Laniel 2021-02-25  28  #endif
a28a6e860c6cf2 Francis Laniel 2021-02-25  29  

:::::: The code at line 25 was first introduced by commit
:::::: a28a6e860c6cf231cf3c5171c75c342adcd00406 string.h: move fortified functions definitions in a dedicated header.

:::::: TO: Francis Laniel <laniel_francis@xxxxxxxxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux