Skip to contentSkip to conversation

drivers/net/bonding sparse errors

PATCH Applied Ben Dooks 2 participants 5 messages Sep 14, 2008 – Oct 13, 2008

Subsystems (3)
lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

cover drivers/net/bonding sparse errors

drivers/net/bonding throws a large number of warnings when compiling a kernel with sparse. These two patches remove the easiest offenders to try and cut down the number and see what is important.

Signature · 3 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'
author
#1 lore raw

PATCH 1/2 drivers/net/bonding: sparse fixes for exported tables

The following sparse warnings are being generated because bonding.h is missing definitons for items declared in bond_main.c but also used in bond_sysfs.h

Also export bond_dev_list as this is also declared in bond_main but used elsewhere in drivers/net/bonding.

bond_main.c:105:20: warning: symbol 'bonding_defaults' was not declared. Should it be static? bond_main.c:148:1: warning: symbol 'bond_dev_list' was not declared. Should it be static? bond_main.c:162:22: warning: symbol 'bond_lacp_tbl' was not declared. Should it be static? bond_main.c:168:22: warning: symbol 'bond_mode_tbl' was not declared. Should it be static? bond_main.c:179:22: warning: symbol 'xmit_hashtype_tbl' was not declared. Should it be static? bond_main.c:186:22: warning: symbol 'arp_validate_tbl' was not declared. Should it be static? bond_main.c:194:22: warning: symbol 'fail_over_mac_tbl' was not declared. Should it be static?

drivers/net/bonding/bonding.h +8 -0
Index: linux-git-test-next-cats/drivers/net/bonding/bonding.h
===================================================================
@@ -333,5 +333,13 @@ void bond_change_active_slave(struct bon
 void bond_register_arp(struct bonding *);
 void bond_unregister_arp(struct bonding *);
 
+/* exported from bond_main.c */
+extern struct list_head bond_dev_list;
+extern struct bond_parm_tbl bond_lacp_tbl[];
+extern struct bond_parm_tbl bond_mode_tbl[];
+extern struct bond_parm_tbl xmit_hashtype_tbl[];
+extern struct bond_parm_tbl arp_validate_tbl[];
+extern struct bond_parm_tbl fail_over_mac_tbl[];
+
 #endif /* _LINUX_BONDING_H */
 
Signature · 3 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'
Applied
#2 lore raw

Re: [patch 1/2] drivers/net/bonding: sparse fixes for exported tables

Quoted 22 lines · Ben Dooks

The following sparse warnings are being generated because bonding.h is missing definitons for items declared in bond_main.c but also used in bond_sysfs.h

Also export bond_dev_list as this is also declared in bond_main but used elsewhere in drivers/net/bonding.

bond_main.c:105:20: warning: symbol 'bonding_defaults' was not declared. Should it be static? bond_main.c:148:1: warning: symbol 'bond_dev_list' was not declared. Should it be static? bond_main.c:162:22: warning: symbol 'bond_lacp_tbl' was not declared. Should it be static? bond_main.c:168:22: warning: symbol 'bond_mode_tbl' was not declared. Should it be static? bond_main.c:179:22: warning: symbol 'xmit_hashtype_tbl' was not declared. Should it be static? bond_main.c:186:22: warning: symbol 'arp_validate_tbl' was not declared. Should it be static? bond_main.c:194:22: warning: symbol 'fail_over_mac_tbl' was not declared. Should it be static?

Index: linux-git-test-next-cats/drivers/net/bonding/bonding.h
===================================================================

drivers/net/bonding/bonding.h void bond_change_active_slave(struct bon · line 342

Quoted 10 lines
drivers/net/bonding/bonding.h +7 -0
@@ -333,5 +333,13 @@ void bond_change_active_slave(struct bon
 void bond_register_arp(struct bonding *);
 void bond_unregister_arp(struct bonding *);
 
+/* exported from bond_main.c */
+extern struct list_head bond_dev_list;
+extern struct bond_parm_tbl bond_lacp_tbl[];
+extern struct bond_parm_tbl bond_mode_tbl[];
+extern struct bond_parm_tbl xmit_hashtype_tbl[];
+extern struct bond_parm_tbl arp_validate_tbl[];
+extern struct bond_parm_tbl fail_over_mac_tbl[];

applied

patch #2 failed to apply

author
#3 lore raw

Re: [patch 1/2] drivers/net/bonding: sparse fixes for exported tables

Quoted 35 lines · Jeff Garzik
Quoted 22 lines · Ben Dooks

The following sparse warnings are being generated because bonding.h is missing definitons for items declared in bond_main.c but also used in bond_sysfs.h

Also export bond_dev_list as this is also declared in bond_main but used elsewhere in drivers/net/bonding.

bond_main.c:105:20: warning: symbol 'bonding_defaults' was not declared. Should it be static? bond_main.c:148:1: warning: symbol 'bond_dev_list' was not declared. Should it be static? bond_main.c:162:22: warning: symbol 'bond_lacp_tbl' was not declared. Should it be static? bond_main.c:168:22: warning: symbol 'bond_mode_tbl' was not declared. Should it be static? bond_main.c:179:22: warning: symbol 'xmit_hashtype_tbl' was not declared. Should it be static? bond_main.c:186:22: warning: symbol 'arp_validate_tbl' was not declared. Should it be static? bond_main.c:194:22: warning: symbol 'fail_over_mac_tbl' was not declared. Should it be static?

Index: linux-git-test-next-cats/drivers/net/bonding/bonding.h
===================================================================

drivers/net/bonding/bonding.h void bond_change_active_slave(struct bon · line 341

Quoted 9 lines
drivers/net/bonding/bonding.h +6 -0
@@ -333,5 +333,13 @@ void bond_change_active_slave(struct bon
 void bond_register_arp(struct bonding *);
 void bond_unregister_arp(struct bonding *);
 +/* exported from bond_main.c */
+extern struct list_head bond_dev_list;
+extern struct bond_parm_tbl bond_lacp_tbl[];
+extern struct bond_parm_tbl bond_mode_tbl[];
+extern struct bond_parm_tbl xmit_hashtype_tbl[];
+extern struct bond_parm_tbl arp_validate_tbl[];
+extern struct bond_parm_tbl fail_over_mac_tbl[];

applied

Quoted 1 line

patch #2 failed to apply

ok, will sort this out and send a new patch.

Signature · 3 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'
author
#4 lore raw

PATCH 2/2 drivers/net/bonding: move mutex decleration to header

In reply to Ben Dooks

Fix the sparse error generated by bonding_mutex being declared in bond_sysfs.c but used in bond_main.c by declaring an 'extern' in bond_main.c. Fix this by moving the bond_main decleration to bonding.h.

The sparse warning is as follows:

bond_sysfs.c:67:14: warning: symbol 'bonding_mutex' was not declared. Should it be static?

drivers/net/bonding/bond_main.c +0 -1
Index: linux-git-test-next-cats/drivers/net/bonding/bond_main.c
===================================================================
@@ -151,7 +151,6 @@ LIST_HEAD(bond_dev_list);
 static struct proc_dir_entry *bond_proc_dir = NULL;
 #endif
 
-extern struct mutex bonding_mutex;
 static __be32 arp_target[BOND_MAX_ARP_TARGETS] = { 0, } ;
 static int arp_ip_count	= 0;
 static int bond_mode	= BOND_MODE_ROUNDROBIN;
drivers/net/bonding/bonding.h +3 -0
Index: linux-git-test-next-cats/drivers/net/bonding/bonding.h
===================================================================
@@ -342,5 +342,8 @@ extern struct bond_parm_tbl xmit_hashtyp
 extern struct bond_parm_tbl arp_validate_tbl[];
 extern struct bond_parm_tbl fail_over_mac_tbl[];
 
+/* exported from bond_sysfs.c */
+extern struct mutex bonding_mutex;
+
 #endif /* _LINUX_BONDING_H */
 
Signature · 3 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'