[driver-core:usermode_ro 5/5] kernel/ksysfs.c:45:30: error: 'uevent_helper' undeclared

kbuild test robot fengguang.wu at intel.com
Thu Dec 15 21:55:01 UTC 2016


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git usermode_ro
head:   98be6f5802fc3ace7f105aca608a34f56e53dbe6
commit: 98be6f5802fc3ace7f105aca608a34f56e53dbe6 [5/5] add CONFIG_READONLY_USERMODEHELPER support for lots of places.
config: sparc-defconfig (attached as .config)
compiler: sparc-linux-gcc (GCC) 6.2.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 98be6f5802fc3ace7f105aca608a34f56e53dbe6
        # save the attached .config to linux build tree
        make.cross ARCH=sparc 

All error/warnings (new ones prefixed by >>):

   In file included from kernel/ksysfs.c:11:0:
   include/linux/kobject.h:37:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'uevent_helper'
    extern char __ro_umh uevent_helper[];
                         ^~~~~~~~~~~~~
   kernel/ksysfs.c: In function 'uevent_helper_show':
>> kernel/ksysfs.c:45:30: error: 'uevent_helper' undeclared (first use in this function)
     return sprintf(buf, "%s\n", uevent_helper);
                                 ^~~~~~~~~~~~~
   kernel/ksysfs.c:45:30: note: each undeclared identifier is reported only once for each function it appears in
   In file included from include/linux/string.h:18:0,
                    from include/linux/bitmap.h:8,
                    from include/linux/cpumask.h:11,
                    from arch/sparc/include/asm/smp_32.h:14,
                    from arch/sparc/include/asm/smp.h:6,
                    from arch/sparc/include/asm/switch_to_32.h:4,
                    from arch/sparc/include/asm/switch_to.h:6,
                    from arch/sparc/include/asm/ptrace.h:117,
                    from arch/sparc/include/asm/thread_info_32.h:18,
                    from arch/sparc/include/asm/thread_info.h:6,
                    from include/linux/thread_info.h:25,
                    from arch/sparc/include/asm/current.h:14,
                    from include/linux/mutex.h:13,
                    from include/linux/kernfs.h:13,
                    from include/linux/sysfs.h:15,
                    from include/linux/kobject.h:21,
                    from kernel/ksysfs.c:11:
   kernel/ksysfs.c: In function 'uevent_helper_store':
   kernel/ksysfs.c:54:9: error: 'uevent_helper' undeclared (first use in this function)
     memcpy(uevent_helper, buf, count);
            ^
   arch/sparc/include/asm/string.h:14:42: note: in definition of macro 'memcpy'
    #define memcpy(t, f, n) __builtin_memcpy(t, f, n)
                                             ^
   kernel/ksysfs.c: In function 'uevent_helper_show':
>> kernel/ksysfs.c:46:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^

vim +/uevent_helper +45 kernel/ksysfs.c

^1da177e4 Linus Torvalds                2005-04-16   5   * Copyright (C) 2004 Kay Sievers <kay.sievers at vrfy.org>
^1da177e4 Linus Torvalds                2005-04-16   6   * 
^1da177e4 Linus Torvalds                2005-04-16   7   * This file is release under the GPLv2
^1da177e4 Linus Torvalds                2005-04-16   8   *
^1da177e4 Linus Torvalds                2005-04-16   9   */
^1da177e4 Linus Torvalds                2005-04-16  10  
^1da177e4 Linus Torvalds                2005-04-16 @11  #include <linux/kobject.h>
^1da177e4 Linus Torvalds                2005-04-16  12  #include <linux/string.h>
^1da177e4 Linus Torvalds                2005-04-16  13  #include <linux/sysfs.h>
9984de1a5 Paul Gortmaker                2011-05-23  14  #include <linux/export.h>
^1da177e4 Linus Torvalds                2005-04-16  15  #include <linux/init.h>
c330dda90 Jeff Moyer                    2006-06-23  16  #include <linux/kexec.h>
22b8ce947 Dave Hansen                   2008-10-15  17  #include <linux/profile.h>
1596425fd Paul Gortmaker                2011-07-28  18  #include <linux/stat.h>
5cb350baf Dhaval Giani                  2007-10-15  19  #include <linux/sched.h>
088ab0b4d Ludwig Nussel                 2011-02-28  20  #include <linux/capability.h>
52f5684c8 Gideon Israel Dsouza          2014-04-07  21  #include <linux/compiler.h>
^1da177e4 Linus Torvalds                2005-04-16  22  
5a9be7c62 Paul E. McKenney              2015-11-24  23  #include <linux/rcupdate.h>	/* rcu_expedited and rcu_normal */
7a7547431 Paul Gortmaker                2014-02-11  24  
^1da177e4 Linus Torvalds                2005-04-16  25  #define KERNEL_ATTR_RO(_name) \
386f275f5 Kay Sievers                   2007-11-02  26  static struct kobj_attribute _name##_attr = __ATTR_RO(_name)
^1da177e4 Linus Torvalds                2005-04-16  27  
^1da177e4 Linus Torvalds                2005-04-16  28  #define KERNEL_ATTR_RW(_name) \
386f275f5 Kay Sievers                   2007-11-02  29  static struct kobj_attribute _name##_attr = \
^1da177e4 Linus Torvalds                2005-04-16  30  	__ATTR(_name, 0644, _name##_show, _name##_store)
^1da177e4 Linus Torvalds                2005-04-16  31  
0f76e5acf Kay Sievers                   2005-11-11  32  /* current uevent sequence number */
386f275f5 Kay Sievers                   2007-11-02  33  static ssize_t uevent_seqnum_show(struct kobject *kobj,
386f275f5 Kay Sievers                   2007-11-02  34  				  struct kobj_attribute *attr, char *buf)
^1da177e4 Linus Torvalds                2005-04-16  35  {
386f275f5 Kay Sievers                   2007-11-02  36  	return sprintf(buf, "%llu\n", (unsigned long long)uevent_seqnum);
^1da177e4 Linus Torvalds                2005-04-16  37  }
0f76e5acf Kay Sievers                   2005-11-11  38  KERNEL_ATTR_RO(uevent_seqnum);
0f76e5acf Kay Sievers                   2005-11-11  39  
86d56134f Michael Marineau              2014-04-10  40  #ifdef CONFIG_UEVENT_HELPER
af6658527 Thadeu Lima de Souza Cascardo 2010-01-17  41  /* uevent helper program, used during early boot */
386f275f5 Kay Sievers                   2007-11-02  42  static ssize_t uevent_helper_show(struct kobject *kobj,
386f275f5 Kay Sievers                   2007-11-02  43  				  struct kobj_attribute *attr, char *buf)
0f76e5acf Kay Sievers                   2005-11-11  44  {
386f275f5 Kay Sievers                   2007-11-02 @45  	return sprintf(buf, "%s\n", uevent_helper);
0f76e5acf Kay Sievers                   2005-11-11 @46  }
98be6f580 Greg Kroah-Hartman            2016-12-15  47  #ifndef CONFIG_READONLY_USERMODEHELPER
386f275f5 Kay Sievers                   2007-11-02  48  static ssize_t uevent_helper_store(struct kobject *kobj,
386f275f5 Kay Sievers                   2007-11-02  49  				   struct kobj_attribute *attr,

:::::: The code at line 45 was first introduced by commit
:::::: 386f275f5d097758f867bc99ddeaeb7a03b6b190 Driver Core: switch all dynamic ksets to kobj_sysfs_ops

:::::: TO: Kay Sievers <kay.sievers at vrfy.org>
:::::: CC: Greg Kroah-Hartman <gregkh at suse.de>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 11678 bytes
Desc: not available
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20161216/d5c4c089/attachment.bin>


More information about the devel mailing list