[tip:ras/core 2/2] drivers/ras/debugfs.c:10:5: error: redefinition of 'ras_userspace_consumers'

From: kbuild test robot
Date: Thu Aug 08 2019 - 08:46:30 EST


tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/tip/tip.git ras/core
head: 963c712947207cc6117b4bd68427a63591f18786
commit: 963c712947207cc6117b4bd68427a63591f18786 [2/2] RAS: Fix prototype warnings
config: riscv-defconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 7.4.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 963c712947207cc6117b4bd68427a63591f18786
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=riscv

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> drivers/ras/debugfs.c:10:5: error: redefinition of 'ras_userspace_consumers'
int ras_userspace_consumers(void)
^~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/ras/debugfs.c:3:0:
include/linux/ras.h:14:19: note: previous definition of 'ras_userspace_consumers' was here
static inline int ras_userspace_consumers(void) { return 0; }
^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/ras/debugfs.c:40:12: error: redefinition of 'ras_add_daemon_trace'
int __init ras_add_daemon_trace(void)
^~~~~~~~~~~~~~~~~~~~
In file included from drivers/ras/debugfs.c:3:0:
include/linux/ras.h:16:19: note: previous definition of 'ras_add_daemon_trace' was here
static inline int ras_add_daemon_trace(void) { return 0; }
^~~~~~~~~~~~~~~~~~~~
>> drivers/ras/debugfs.c:56:13: error: redefinition of 'ras_debugfs_init'
void __init ras_debugfs_init(void)
^~~~~~~~~~~~~~~~
In file included from drivers/ras/debugfs.c:3:0:
include/linux/ras.h:15:20: note: previous definition of 'ras_debugfs_init' was here
static inline void ras_debugfs_init(void) { }
^~~~~~~~~~~~~~~~

vim +/ras_userspace_consumers +10 drivers/ras/debugfs.c

d963cd95bea93b Chen, Gong 2014-06-11 9
d963cd95bea93b Chen, Gong 2014-06-11 @10 int ras_userspace_consumers(void)
d963cd95bea93b Chen, Gong 2014-06-11 11 {
d963cd95bea93b Chen, Gong 2014-06-11 12 return atomic_read(&trace_count);
d963cd95bea93b Chen, Gong 2014-06-11 13 }
d963cd95bea93b Chen, Gong 2014-06-11 14 EXPORT_SYMBOL_GPL(ras_userspace_consumers);
d963cd95bea93b Chen, Gong 2014-06-11 15
d963cd95bea93b Chen, Gong 2014-06-11 16 static int trace_show(struct seq_file *m, void *v)
d963cd95bea93b Chen, Gong 2014-06-11 17 {
d963cd95bea93b Chen, Gong 2014-06-11 18 return atomic_read(&trace_count);
d963cd95bea93b Chen, Gong 2014-06-11 19 }
d963cd95bea93b Chen, Gong 2014-06-11 20
d963cd95bea93b Chen, Gong 2014-06-11 21 static int trace_open(struct inode *inode, struct file *file)
d963cd95bea93b Chen, Gong 2014-06-11 22 {
d963cd95bea93b Chen, Gong 2014-06-11 23 atomic_inc(&trace_count);
d963cd95bea93b Chen, Gong 2014-06-11 24 return single_open(file, trace_show, NULL);
d963cd95bea93b Chen, Gong 2014-06-11 25 }
d963cd95bea93b Chen, Gong 2014-06-11 26
d963cd95bea93b Chen, Gong 2014-06-11 27 static int trace_release(struct inode *inode, struct file *file)
d963cd95bea93b Chen, Gong 2014-06-11 28 {
d963cd95bea93b Chen, Gong 2014-06-11 29 atomic_dec(&trace_count);
d963cd95bea93b Chen, Gong 2014-06-11 30 return single_release(inode, file);
d963cd95bea93b Chen, Gong 2014-06-11 31 }
d963cd95bea93b Chen, Gong 2014-06-11 32
d963cd95bea93b Chen, Gong 2014-06-11 33 static const struct file_operations trace_fops = {
d963cd95bea93b Chen, Gong 2014-06-11 34 .open = trace_open,
d963cd95bea93b Chen, Gong 2014-06-11 35 .read = seq_read,
d963cd95bea93b Chen, Gong 2014-06-11 36 .llseek = seq_lseek,
d963cd95bea93b Chen, Gong 2014-06-11 37 .release = trace_release,
d963cd95bea93b Chen, Gong 2014-06-11 38 };
d963cd95bea93b Chen, Gong 2014-06-11 39
d963cd95bea93b Chen, Gong 2014-06-11 @40 int __init ras_add_daemon_trace(void)
d963cd95bea93b Chen, Gong 2014-06-11 41 {
d963cd95bea93b Chen, Gong 2014-06-11 42 struct dentry *fentry;
d963cd95bea93b Chen, Gong 2014-06-11 43
d963cd95bea93b Chen, Gong 2014-06-11 44 if (!ras_debugfs_dir)
d963cd95bea93b Chen, Gong 2014-06-11 45 return -ENOENT;
d963cd95bea93b Chen, Gong 2014-06-11 46
d963cd95bea93b Chen, Gong 2014-06-11 47 fentry = debugfs_create_file("daemon_active", S_IRUSR, ras_debugfs_dir,
d963cd95bea93b Chen, Gong 2014-06-11 48 NULL, &trace_fops);
d963cd95bea93b Chen, Gong 2014-06-11 49 if (!fentry)
d963cd95bea93b Chen, Gong 2014-06-11 50 return -ENODEV;
d963cd95bea93b Chen, Gong 2014-06-11 51
d963cd95bea93b Chen, Gong 2014-06-11 52 return 0;
d963cd95bea93b Chen, Gong 2014-06-11 53
d963cd95bea93b Chen, Gong 2014-06-11 54 }
d963cd95bea93b Chen, Gong 2014-06-11 55
d963cd95bea93b Chen, Gong 2014-06-11 @56 void __init ras_debugfs_init(void)

:::::: The code at line 10 was first introduced by commit
:::::: d963cd95bea93b7db9390a71d1e2cabbb3b2c3ea RAS, debugfs: Add debugfs interface for RAS subsystem

:::::: TO: Chen, Gong <gong.chen@xxxxxxxxxxxxxxx>
:::::: CC: Tony Luck <tony.luck@xxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip