Skip to content

Commit 477bb93

Browse files
stephen hemmingerdavem330
authored andcommitted
net: remove dead code for add/del multiple
These function to manipulate multiple addresses are not used anywhere in current net-next tree. Some out of tree code maybe using these but too bad; they should submit their code upstream.. Also, make __hw_addr_flush local since only used by dev_addr_lists.c Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6ea09d8 commit 477bb93

2 files changed

Lines changed: 1 addition & 107 deletions

File tree

‎include/linux/netdevice.h‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2810,28 +2810,17 @@ int register_netdev(struct net_device *dev);
28102810
void unregister_netdev(struct net_device *dev);
28112811

28122812
/* General hardware address lists handling functions */
2813-
int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list,
2814-
struct netdev_hw_addr_list *from_list,
2815-
int addr_len, unsigned char addr_type);
2816-
void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list,
2817-
struct netdev_hw_addr_list *from_list,
2818-
int addr_len, unsigned char addr_type);
28192813
int __hw_addr_sync(struct netdev_hw_addr_list *to_list,
28202814
struct netdev_hw_addr_list *from_list, int addr_len);
28212815
void __hw_addr_unsync(struct netdev_hw_addr_list *to_list,
28222816
struct netdev_hw_addr_list *from_list, int addr_len);
2823-
void __hw_addr_flush(struct netdev_hw_addr_list *list);
28242817
void __hw_addr_init(struct netdev_hw_addr_list *list);
28252818

28262819
/* Functions used for device addresses handling */
28272820
int dev_addr_add(struct net_device *dev, const unsigned char *addr,
28282821
unsigned char addr_type);
28292822
int dev_addr_del(struct net_device *dev, const unsigned char *addr,
28302823
unsigned char addr_type);
2831-
int dev_addr_add_multiple(struct net_device *to_dev,
2832-
struct net_device *from_dev, unsigned char addr_type);
2833-
int dev_addr_del_multiple(struct net_device *to_dev,
2834-
struct net_device *from_dev, unsigned char addr_type);
28352824
void dev_addr_flush(struct net_device *dev);
28362825
int dev_addr_init(struct net_device *dev);
28372826

‎net/core/dev_addr_lists.c‎

Lines changed: 1 addition & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -186,47 +186,6 @@ static int __hw_addr_sync_multiple(struct netdev_hw_addr_list *to_list,
186186
return err;
187187
}
188188

189-
int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list,
190-
struct netdev_hw_addr_list *from_list,
191-
int addr_len, unsigned char addr_type)
192-
{
193-
int err;
194-
struct netdev_hw_addr *ha, *ha2;
195-
unsigned char type;
196-
197-
list_for_each_entry(ha, &from_list->list, list) {
198-
type = addr_type ? addr_type : ha->type;
199-
err = __hw_addr_add(to_list, ha->addr, addr_len, type);
200-
if (err)
201-
goto unroll;
202-
}
203-
return 0;
204-
205-
unroll:
206-
list_for_each_entry(ha2, &from_list->list, list) {
207-
if (ha2 == ha)
208-
break;
209-
type = addr_type ? addr_type : ha2->type;
210-
__hw_addr_del(to_list, ha2->addr, addr_len, type);
211-
}
212-
return err;
213-
}
214-
EXPORT_SYMBOL(__hw_addr_add_multiple);
215-
216-
void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list,
217-
struct netdev_hw_addr_list *from_list,
218-
int addr_len, unsigned char addr_type)
219-
{
220-
struct netdev_hw_addr *ha;
221-
unsigned char type;
222-
223-
list_for_each_entry(ha, &from_list->list, list) {
224-
type = addr_type ? addr_type : ha->type;
225-
__hw_addr_del(to_list, ha->addr, addr_len, type);
226-
}
227-
}
228-
EXPORT_SYMBOL(__hw_addr_del_multiple);
229-
230189
/* This function only works where there is a strict 1-1 relationship
231190
* between source and destionation of they synch. If you ever need to
232191
* sync addresses to more then 1 destination, you need to use
@@ -264,7 +223,7 @@ void __hw_addr_unsync(struct netdev_hw_addr_list *to_list,
264223
}
265224
EXPORT_SYMBOL(__hw_addr_unsync);
266225

267-
void __hw_addr_flush(struct netdev_hw_addr_list *list)
226+
static void __hw_addr_flush(struct netdev_hw_addr_list *list)
268227
{
269228
struct netdev_hw_addr *ha, *tmp;
270229

@@ -274,7 +233,6 @@ void __hw_addr_flush(struct netdev_hw_addr_list *list)
274233
}
275234
list->count = 0;
276235
}
277-
EXPORT_SYMBOL(__hw_addr_flush);
278236

279237
void __hw_addr_init(struct netdev_hw_addr_list *list)
280238
{
@@ -400,59 +358,6 @@ int dev_addr_del(struct net_device *dev, const unsigned char *addr,
400358
}
401359
EXPORT_SYMBOL(dev_addr_del);
402360

403-
/**
404-
* dev_addr_add_multiple - Add device addresses from another device
405-
* @to_dev: device to which addresses will be added
406-
* @from_dev: device from which addresses will be added
407-
* @addr_type: address type - 0 means type will be used from from_dev
408-
*
409-
* Add device addresses of the one device to another.
410-
**
411-
* The caller must hold the rtnl_mutex.
412-
*/
413-
int dev_addr_add_multiple(struct net_device *to_dev,
414-
struct net_device *from_dev,
415-
unsigned char addr_type)
416-
{
417-
int err;
418-
419-
ASSERT_RTNL();
420-
421-
if (from_dev->addr_len != to_dev->addr_len)
422-
return -EINVAL;
423-
err = __hw_addr_add_multiple(&to_dev->dev_addrs, &from_dev->dev_addrs,
424-
to_dev->addr_len, addr_type);
425-
if (!err)
426-
call_netdevice_notifiers(NETDEV_CHANGEADDR, to_dev);
427-
return err;
428-
}
429-
EXPORT_SYMBOL(dev_addr_add_multiple);
430-
431-
/**
432-
* dev_addr_del_multiple - Delete device addresses by another device
433-
* @to_dev: device where the addresses will be deleted
434-
* @from_dev: device supplying the addresses to be deleted
435-
* @addr_type: address type - 0 means type will be used from from_dev
436-
*
437-
* Deletes addresses in to device by the list of addresses in from device.
438-
*
439-
* The caller must hold the rtnl_mutex.
440-
*/
441-
int dev_addr_del_multiple(struct net_device *to_dev,
442-
struct net_device *from_dev,
443-
unsigned char addr_type)
444-
{
445-
ASSERT_RTNL();
446-
447-
if (from_dev->addr_len != to_dev->addr_len)
448-
return -EINVAL;
449-
__hw_addr_del_multiple(&to_dev->dev_addrs, &from_dev->dev_addrs,
450-
to_dev->addr_len, addr_type);
451-
call_netdevice_notifiers(NETDEV_CHANGEADDR, to_dev);
452-
return 0;
453-
}
454-
EXPORT_SYMBOL(dev_addr_del_multiple);
455-
456361
/*
457362
* Unicast list handling functions
458363
*/

0 commit comments

Comments
 (0)