[rcu:dev.2019.03.12a 64/65] drivers/char/ipmi/ipmi_msghandler.c:615:1: error: type defaults to 'int' in declaration of 'DEFINE_STATIC_SRCU'

From: kbuild test robot
Date: Mon Mar 18 2019 - 18:52:48 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2019.03.12a
head: 667a45dd2b898f2aaf6dcbfa471c8a23f603bde5
commit: a3f5f4fae7255e7ed4a5a8be80612cdd76c65ac6 [64/65] rcu: Forbid DEFINE{,_STATIC}_SRCU() from modules
config: i386-randconfig-l0-03190330 (attached as .config)
compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
reproduce:
git checkout a3f5f4fae7255e7ed4a5a8be80612cdd76c65ac6
# save the attached .config to linux build tree
make ARCH=i386

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

>> drivers/char/ipmi/ipmi_msghandler.c:615:1: warning: data definition has no type or storage class
DEFINE_STATIC_SRCU(ipmi_interfaces_srcu);
^
>> drivers/char/ipmi/ipmi_msghandler.c:615:1: error: type defaults to 'int' in declaration of 'DEFINE_STATIC_SRCU' [-Werror=implicit-int]
>> drivers/char/ipmi/ipmi_msghandler.c:615:1: warning: parameter names (without types) in function declaration
drivers/char/ipmi/ipmi_msghandler.c: In function 'ipmi_smi_watcher_register':
>> drivers/char/ipmi/ipmi_msghandler.c:729:26: error: 'ipmi_interfaces_srcu' undeclared (first use in this function)
index = srcu_read_lock(&ipmi_interfaces_srcu);
^
drivers/char/ipmi/ipmi_msghandler.c:729:26: note: each undeclared identifier is reported only once for each function it appears in
drivers/char/ipmi/ipmi_msghandler.c: In function 'ipmi_create_user':
drivers/char/ipmi/ipmi_msghandler.c:1114:26: error: 'ipmi_interfaces_srcu' undeclared (first use in this function)
index = srcu_read_lock(&ipmi_interfaces_srcu);
^
drivers/char/ipmi/ipmi_msghandler.c: In function 'ipmi_get_smi_info':
drivers/char/ipmi/ipmi_msghandler.c:1162:26: error: 'ipmi_interfaces_srcu' undeclared (first use in this function)
index = srcu_read_lock(&ipmi_interfaces_srcu);
^
drivers/char/ipmi/ipmi_msghandler.c: In function 'ipmi_register_smi':
drivers/char/ipmi/ipmi_msghandler.c:3417:20: error: 'ipmi_interfaces_srcu' undeclared (first use in this function)
synchronize_srcu(&ipmi_interfaces_srcu);
^
drivers/char/ipmi/ipmi_msghandler.c: In function 'ipmi_unregister_smi':
drivers/char/ipmi/ipmi_msghandler.c:3487:20: error: 'ipmi_interfaces_srcu' undeclared (first use in this function)
synchronize_srcu(&ipmi_interfaces_srcu);
^
drivers/char/ipmi/ipmi_msghandler.c: In function 'ipmi_timeout':
drivers/char/ipmi/ipmi_msghandler.c:4658:26: error: 'ipmi_interfaces_srcu' undeclared (first use in this function)
index = srcu_read_lock(&ipmi_interfaces_srcu);
^
cc1: some warnings being treated as errors
--
>> drivers/dax/super.c:27:1: warning: data definition has no type or storage class
DEFINE_STATIC_SRCU(dax_srcu);
^
>> drivers/dax/super.c:27:1: error: type defaults to 'int' in declaration of 'DEFINE_STATIC_SRCU' [-Werror=implicit-int]
>> drivers/dax/super.c:27:1: warning: parameter names (without types) in function declaration
drivers/dax/super.c: In function 'dax_read_lock':
>> drivers/dax/super.c:39:25: error: 'dax_srcu' undeclared (first use in this function)
return srcu_read_lock(&dax_srcu);
^
drivers/dax/super.c:39:25: note: each undeclared identifier is reported only once for each function it appears in
drivers/dax/super.c: In function 'dax_read_unlock':
drivers/dax/super.c:45:20: error: 'dax_srcu' undeclared (first use in this function)
srcu_read_unlock(&dax_srcu, id);
^
In file included from arch/x86/include/asm/bug.h:83:0,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/mm.h:9,
from include/linux/pagemap.h:8,
from drivers/dax/super.c:13:
drivers/dax/super.c: In function 'dax_alive':
drivers/dax/super.c:340:23: error: 'dax_srcu' undeclared (first use in this function)
lockdep_assert_held(&dax_srcu);
^
include/asm-generic/bug.h:122:25: note: in definition of macro 'WARN_ON'
int __ret_warn_on = !!(condition); \
^
include/linux/lockdep.h:366:27: note: in expansion of macro 'lockdep_is_held'
WARN_ON(debug_locks && !lockdep_is_held(l)); \
^
drivers/dax/super.c:340:2: note: in expansion of macro 'lockdep_assert_held'
lockdep_assert_held(&dax_srcu);
^
drivers/dax/super.c: In function 'kill_dax':
drivers/dax/super.c:363:20: error: 'dax_srcu' undeclared (first use in this function)
synchronize_srcu(&dax_srcu);
^
drivers/dax/super.c: In function 'dax_read_lock':
drivers/dax/super.c:40:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
cc1: some warnings being treated as errors

vim +615 drivers/char/ipmi/ipmi_msghandler.c

50c812b2b Corey Minyard 2006-03-26 612
bed9759b2 Denis Cheng 2008-02-06 613 static LIST_HEAD(ipmi_interfaces);
bca0324d0 Corey Minyard 2006-12-06 614 static DEFINE_MUTEX(ipmi_interfaces_mutex);
e86ee2d44 Corey Minyard 2018-04-05 @615 DEFINE_STATIC_SRCU(ipmi_interfaces_srcu);
^1da177e4 Linus Torvalds 2005-04-16 616
c70d74998 Corey Minyard 2008-04-29 617 /*
c70d74998 Corey Minyard 2008-04-29 618 * List of watchers that want to know when smi's are added and deleted.
c70d74998 Corey Minyard 2008-04-29 619 */
bed9759b2 Denis Cheng 2008-02-06 620 static LIST_HEAD(smi_watchers);
b2c03941b Corey Minyard 2006-12-06 621 static DEFINE_MUTEX(smi_watchers_mutex);
^1da177e4 Linus Torvalds 2005-04-16 622
b2655f261 Konstantin Baydarov 2008-04-29 623 #define ipmi_inc_stat(intf, stat) \
b2655f261 Konstantin Baydarov 2008-04-29 624 atomic_inc(&(intf)->stats[IPMI_STAT_ ## stat])
b2655f261 Konstantin Baydarov 2008-04-29 625 #define ipmi_get_stat(intf, stat) \
b2655f261 Konstantin Baydarov 2008-04-29 626 ((unsigned int) atomic_read(&(intf)->stats[IPMI_STAT_ ## stat]))
b2655f261 Konstantin Baydarov 2008-04-29 627
99ee67351 LABBE Corentin 2015-11-13 628 static const char * const addr_src_to_str[] = {
99ee67351 LABBE Corentin 2015-11-13 629 "invalid", "hotmod", "hardcoded", "SPMI", "ACPI", "SMBIOS", "PCI",
95e300c05 Corey Minyard 2017-09-18 630 "device-tree", "platform"
99ee67351 LABBE Corentin 2015-11-13 631 };
7e50387bc Corey Minyard 2014-10-09 632
7e50387bc Corey Minyard 2014-10-09 633 const char *ipmi_addr_src_to_str(enum ipmi_addr_src src)
7e50387bc Corey Minyard 2014-10-09 634 {
b07b58a3e Tony Camuso 2016-06-22 635 if (src >= SI_LAST)
7e50387bc Corey Minyard 2014-10-09 636 src = 0; /* Invalid */
7e50387bc Corey Minyard 2014-10-09 637 return addr_src_to_str[src];
7e50387bc Corey Minyard 2014-10-09 638 }
7e50387bc Corey Minyard 2014-10-09 639 EXPORT_SYMBOL(ipmi_addr_src_to_str);
7e50387bc Corey Minyard 2014-10-09 640
25176ed67 Corey Minyard 2009-04-21 641 static int is_lan_addr(struct ipmi_addr *addr)
25176ed67 Corey Minyard 2009-04-21 642 {
25176ed67 Corey Minyard 2009-04-21 643 return addr->addr_type == IPMI_LAN_ADDR_TYPE;
25176ed67 Corey Minyard 2009-04-21 644 }
25176ed67 Corey Minyard 2009-04-21 645
25176ed67 Corey Minyard 2009-04-21 646 static int is_ipmb_addr(struct ipmi_addr *addr)
25176ed67 Corey Minyard 2009-04-21 647 {
25176ed67 Corey Minyard 2009-04-21 648 return addr->addr_type == IPMI_IPMB_ADDR_TYPE;
25176ed67 Corey Minyard 2009-04-21 649 }
25176ed67 Corey Minyard 2009-04-21 650
25176ed67 Corey Minyard 2009-04-21 651 static int is_ipmb_bcast_addr(struct ipmi_addr *addr)
25176ed67 Corey Minyard 2009-04-21 652 {
25176ed67 Corey Minyard 2009-04-21 653 return addr->addr_type == IPMI_IPMB_BROADCAST_ADDR_TYPE;
25176ed67 Corey Minyard 2009-04-21 654 }
b2655f261 Konstantin Baydarov 2008-04-29 655
393d2cc35 Corey Minyard 2005-11-07 656 static void free_recv_msg_list(struct list_head *q)
393d2cc35 Corey Minyard 2005-11-07 657 {
393d2cc35 Corey Minyard 2005-11-07 658 struct ipmi_recv_msg *msg, *msg2;
393d2cc35 Corey Minyard 2005-11-07 659
393d2cc35 Corey Minyard 2005-11-07 660 list_for_each_entry_safe(msg, msg2, q, link) {
393d2cc35 Corey Minyard 2005-11-07 661 list_del(&msg->link);
393d2cc35 Corey Minyard 2005-11-07 662 ipmi_free_recv_msg(msg);
393d2cc35 Corey Minyard 2005-11-07 663 }
393d2cc35 Corey Minyard 2005-11-07 664 }
393d2cc35 Corey Minyard 2005-11-07 665
f3ce6a0ea Corey Minyard 2006-11-08 666 static void free_smi_msg_list(struct list_head *q)
f3ce6a0ea Corey Minyard 2006-11-08 667 {
f3ce6a0ea Corey Minyard 2006-11-08 668 struct ipmi_smi_msg *msg, *msg2;
f3ce6a0ea Corey Minyard 2006-11-08 669
f3ce6a0ea Corey Minyard 2006-11-08 670 list_for_each_entry_safe(msg, msg2, q, link) {
f3ce6a0ea Corey Minyard 2006-11-08 671 list_del(&msg->link);
f3ce6a0ea Corey Minyard 2006-11-08 672 ipmi_free_smi_msg(msg);
f3ce6a0ea Corey Minyard 2006-11-08 673 }
f3ce6a0ea Corey Minyard 2006-11-08 674 }
f3ce6a0ea Corey Minyard 2006-11-08 675
a567b6230 Corey Minyard 2018-04-05 676 static void clean_up_interface_data(struct ipmi_smi *intf)
393d2cc35 Corey Minyard 2005-11-07 677 {
393d2cc35 Corey Minyard 2005-11-07 678 int i;
393d2cc35 Corey Minyard 2005-11-07 679 struct cmd_rcvr *rcvr, *rcvr2;
393d2cc35 Corey Minyard 2005-11-07 680 struct list_head list;
393d2cc35 Corey Minyard 2005-11-07 681
7adf579c8 Corey Minyard 2012-03-28 682 tasklet_kill(&intf->recv_tasklet);
7adf579c8 Corey Minyard 2012-03-28 683
65be75445 Corey Minyard 2014-11-06 684 free_smi_msg_list(&intf->waiting_rcv_msgs);
393d2cc35 Corey Minyard 2005-11-07 685 free_recv_msg_list(&intf->waiting_events);
393d2cc35 Corey Minyard 2005-11-07 686
78ba2faf7 Corey Minyard 2007-02-10 687 /*
78ba2faf7 Corey Minyard 2007-02-10 688 * Wholesale remove all the entries from the list in the
78ba2faf7 Corey Minyard 2007-02-10 689 * interface and wait for RCU to know that none are in use.
78ba2faf7 Corey Minyard 2007-02-10 690 */
d6dfd1310 Corey Minyard 2006-03-31 691 mutex_lock(&intf->cmd_rcvrs_mutex);
78ba2faf7 Corey Minyard 2007-02-10 692 INIT_LIST_HEAD(&list);
78ba2faf7 Corey Minyard 2007-02-10 693 list_splice_init_rcu(&intf->cmd_rcvrs, &list, synchronize_rcu);
d6dfd1310 Corey Minyard 2006-03-31 694 mutex_unlock(&intf->cmd_rcvrs_mutex);
393d2cc35 Corey Minyard 2005-11-07 695
393d2cc35 Corey Minyard 2005-11-07 696 list_for_each_entry_safe(rcvr, rcvr2, &list, link)
393d2cc35 Corey Minyard 2005-11-07 697 kfree(rcvr);
393d2cc35 Corey Minyard 2005-11-07 698
393d2cc35 Corey Minyard 2005-11-07 699 for (i = 0; i < IPMI_IPMB_NUM_SEQ; i++) {
393d2cc35 Corey Minyard 2005-11-07 700 if ((intf->seq_table[i].inuse)
393d2cc35 Corey Minyard 2005-11-07 701 && (intf->seq_table[i].recv_msg))
393d2cc35 Corey Minyard 2005-11-07 702 ipmi_free_recv_msg(intf->seq_table[i].recv_msg);
393d2cc35 Corey Minyard 2005-11-07 703 }
393d2cc35 Corey Minyard 2005-11-07 704 }
393d2cc35 Corey Minyard 2005-11-07 705
393d2cc35 Corey Minyard 2005-11-07 706 static void intf_free(struct kref *ref)
393d2cc35 Corey Minyard 2005-11-07 707 {
a567b6230 Corey Minyard 2018-04-05 708 struct ipmi_smi *intf = container_of(ref, struct ipmi_smi, refcount);
393d2cc35 Corey Minyard 2005-11-07 709
393d2cc35 Corey Minyard 2005-11-07 710 clean_up_interface_data(intf);
393d2cc35 Corey Minyard 2005-11-07 711 kfree(intf);
393d2cc35 Corey Minyard 2005-11-07 712 }
393d2cc35 Corey Minyard 2005-11-07 713
bca0324d0 Corey Minyard 2006-12-06 714 struct watcher_entry {
bca0324d0 Corey Minyard 2006-12-06 715 int intf_num;
a567b6230 Corey Minyard 2018-04-05 716 struct ipmi_smi *intf;
b2c03941b Corey Minyard 2006-12-06 717 struct list_head link;
bca0324d0 Corey Minyard 2006-12-06 718 };
bca0324d0 Corey Minyard 2006-12-06 719
^1da177e4 Linus Torvalds 2005-04-16 720 int ipmi_smi_watcher_register(struct ipmi_smi_watcher *watcher)
^1da177e4 Linus Torvalds 2005-04-16 721 {
a567b6230 Corey Minyard 2018-04-05 722 struct ipmi_smi *intf;
e86ee2d44 Corey Minyard 2018-04-05 723 int index;
bca0324d0 Corey Minyard 2006-12-06 724
b2c03941b Corey Minyard 2006-12-06 725 mutex_lock(&smi_watchers_mutex);
b2c03941b Corey Minyard 2006-12-06 726
b2c03941b Corey Minyard 2006-12-06 727 list_add(&watcher->link, &smi_watchers);
bca0324d0 Corey Minyard 2006-12-06 728
e86ee2d44 Corey Minyard 2018-04-05 @729 index = srcu_read_lock(&ipmi_interfaces_srcu);
e86ee2d44 Corey Minyard 2018-04-05 730 list_for_each_entry_rcu(intf, &ipmi_interfaces, link) {
e86ee2d44 Corey Minyard 2018-04-05 731 int intf_num = READ_ONCE(intf->intf_num);
bca0324d0 Corey Minyard 2006-12-06 732
e86ee2d44 Corey Minyard 2018-04-05 733 if (intf_num == -1)
e86ee2d44 Corey Minyard 2018-04-05 734 continue;
e86ee2d44 Corey Minyard 2018-04-05 735 watcher->new_smi(intf_num, intf->si_dev);
^1da177e4 Linus Torvalds 2005-04-16 736 }
e86ee2d44 Corey Minyard 2018-04-05 737 srcu_read_unlock(&ipmi_interfaces_srcu, index);
bca0324d0 Corey Minyard 2006-12-06 738
b2c03941b Corey Minyard 2006-12-06 739 mutex_unlock(&smi_watchers_mutex);
bca0324d0 Corey Minyard 2006-12-06 740
^1da177e4 Linus Torvalds 2005-04-16 741 return 0;
^1da177e4 Linus Torvalds 2005-04-16 742 }
c70d74998 Corey Minyard 2008-04-29 743 EXPORT_SYMBOL(ipmi_smi_watcher_register);
^1da177e4 Linus Torvalds 2005-04-16 744

:::::: The code at line 615 was first introduced by commit
:::::: e86ee2d44b44056243da17c120ad258717cedf9b ipmi: Rework locking and shutdown for hot remove

:::::: TO: Corey Minyard <cminyard@xxxxxxxxxx>
:::::: CC: Corey Minyard <cminyard@xxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip