drivers/net/bonding sparse errors
Subsystems (3)
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'
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
@@ -333,5 +333,13 @@ void bond_change_active_slave(struct bonvoid 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'
Jeff Garzik
AppliedRe: [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.his missing definitons for items declared inbond_main.cbut also used inbond_sysfs.hAlso export
bond_dev_listas this is also declared inbond_mainbut used elsewhere indrivers/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?Signed-off-by Ben Dooks <[email protected]>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 bonvoid 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
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.his missing definitons for items declared inbond_main.cbut also used inbond_sysfs.hAlso export
bond_dev_listas this is also declared inbond_mainbut used elsewhere indrivers/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?Signed-off-by Ben Dooks <[email protected]>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 bonvoid 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'
PATCH 2/2 drivers/net/bonding: move mutex decleration to header
In reply to Ben DooksFix 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
@@ -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
@@ -342,5 +342,8 @@ extern struct bond_parm_tbl xmit_hashtypextern 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'