diff options
author | stephen hemminger <shemminger@vyatta.com> | 2012-09-17 06:03:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-19 16:35:22 -0400 |
commit | 6b6e27255f29a6191ef8ad96bfcc392ab2ef6c71 (patch) | |
tree | a5ccefbbb2862f3777b83eefd1d10a2f550345f8 /net/core | |
parent | 1d3ff76759b70e201e6b379c37ac106c487ff506 (diff) |
netdev: make address const in device address management
The internal functions for add/deleting addresses don't change
their argument.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev_addr_lists.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c index c4cc2bc49f06..87cc17db2d56 100644 --- a/net/core/dev_addr_lists.c +++ b/net/core/dev_addr_lists.c | |||
@@ -22,7 +22,7 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | static int __hw_addr_create_ex(struct netdev_hw_addr_list *list, | 24 | static int __hw_addr_create_ex(struct netdev_hw_addr_list *list, |
25 | unsigned char *addr, int addr_len, | 25 | const unsigned char *addr, int addr_len, |
26 | unsigned char addr_type, bool global) | 26 | unsigned char addr_type, bool global) |
27 | { | 27 | { |
28 | struct netdev_hw_addr *ha; | 28 | struct netdev_hw_addr *ha; |
@@ -46,7 +46,7 @@ static int __hw_addr_create_ex(struct netdev_hw_addr_list *list, | |||
46 | } | 46 | } |
47 | 47 | ||
48 | static int __hw_addr_add_ex(struct netdev_hw_addr_list *list, | 48 | static int __hw_addr_add_ex(struct netdev_hw_addr_list *list, |
49 | unsigned char *addr, int addr_len, | 49 | const unsigned char *addr, int addr_len, |
50 | unsigned char addr_type, bool global) | 50 | unsigned char addr_type, bool global) |
51 | { | 51 | { |
52 | struct netdev_hw_addr *ha; | 52 | struct netdev_hw_addr *ha; |
@@ -72,14 +72,15 @@ static int __hw_addr_add_ex(struct netdev_hw_addr_list *list, | |||
72 | return __hw_addr_create_ex(list, addr, addr_len, addr_type, global); | 72 | return __hw_addr_create_ex(list, addr, addr_len, addr_type, global); |
73 | } | 73 | } |
74 | 74 | ||
75 | static int __hw_addr_add(struct netdev_hw_addr_list *list, unsigned char *addr, | 75 | static int __hw_addr_add(struct netdev_hw_addr_list *list, |
76 | int addr_len, unsigned char addr_type) | 76 | const unsigned char *addr, int addr_len, |
77 | unsigned char addr_type) | ||
77 | { | 78 | { |
78 | return __hw_addr_add_ex(list, addr, addr_len, addr_type, false); | 79 | return __hw_addr_add_ex(list, addr, addr_len, addr_type, false); |
79 | } | 80 | } |
80 | 81 | ||
81 | static int __hw_addr_del_ex(struct netdev_hw_addr_list *list, | 82 | static int __hw_addr_del_ex(struct netdev_hw_addr_list *list, |
82 | unsigned char *addr, int addr_len, | 83 | const unsigned char *addr, int addr_len, |
83 | unsigned char addr_type, bool global) | 84 | unsigned char addr_type, bool global) |
84 | { | 85 | { |
85 | struct netdev_hw_addr *ha; | 86 | struct netdev_hw_addr *ha; |
@@ -104,8 +105,9 @@ static int __hw_addr_del_ex(struct netdev_hw_addr_list *list, | |||
104 | return -ENOENT; | 105 | return -ENOENT; |
105 | } | 106 | } |
106 | 107 | ||
107 | static int __hw_addr_del(struct netdev_hw_addr_list *list, unsigned char *addr, | 108 | static int __hw_addr_del(struct netdev_hw_addr_list *list, |
108 | int addr_len, unsigned char addr_type) | 109 | const unsigned char *addr, int addr_len, |
110 | unsigned char addr_type) | ||
109 | { | 111 | { |
110 | return __hw_addr_del_ex(list, addr, addr_len, addr_type, false); | 112 | return __hw_addr_del_ex(list, addr, addr_len, addr_type, false); |
111 | } | 113 | } |
@@ -278,7 +280,7 @@ EXPORT_SYMBOL(dev_addr_init); | |||
278 | * | 280 | * |
279 | * The caller must hold the rtnl_mutex. | 281 | * The caller must hold the rtnl_mutex. |
280 | */ | 282 | */ |
281 | int dev_addr_add(struct net_device *dev, unsigned char *addr, | 283 | int dev_addr_add(struct net_device *dev, const unsigned char *addr, |
282 | unsigned char addr_type) | 284 | unsigned char addr_type) |
283 | { | 285 | { |
284 | int err; | 286 | int err; |
@@ -303,7 +305,7 @@ EXPORT_SYMBOL(dev_addr_add); | |||
303 | * | 305 | * |
304 | * The caller must hold the rtnl_mutex. | 306 | * The caller must hold the rtnl_mutex. |
305 | */ | 307 | */ |
306 | int dev_addr_del(struct net_device *dev, unsigned char *addr, | 308 | int dev_addr_del(struct net_device *dev, const unsigned char *addr, |
307 | unsigned char addr_type) | 309 | unsigned char addr_type) |
308 | { | 310 | { |
309 | int err; | 311 | int err; |
@@ -390,7 +392,7 @@ EXPORT_SYMBOL(dev_addr_del_multiple); | |||
390 | * @dev: device | 392 | * @dev: device |
391 | * @addr: address to add | 393 | * @addr: address to add |
392 | */ | 394 | */ |
393 | int dev_uc_add_excl(struct net_device *dev, unsigned char *addr) | 395 | int dev_uc_add_excl(struct net_device *dev, const unsigned char *addr) |
394 | { | 396 | { |
395 | struct netdev_hw_addr *ha; | 397 | struct netdev_hw_addr *ha; |
396 | int err; | 398 | int err; |
@@ -421,7 +423,7 @@ EXPORT_SYMBOL(dev_uc_add_excl); | |||
421 | * Add a secondary unicast address to the device or increase | 423 | * Add a secondary unicast address to the device or increase |
422 | * the reference count if it already exists. | 424 | * the reference count if it already exists. |
423 | */ | 425 | */ |
424 | int dev_uc_add(struct net_device *dev, unsigned char *addr) | 426 | int dev_uc_add(struct net_device *dev, const unsigned char *addr) |
425 | { | 427 | { |
426 | int err; | 428 | int err; |
427 | 429 | ||
@@ -443,7 +445,7 @@ EXPORT_SYMBOL(dev_uc_add); | |||
443 | * Release reference to a secondary unicast address and remove it | 445 | * Release reference to a secondary unicast address and remove it |
444 | * from the device if the reference count drops to zero. | 446 | * from the device if the reference count drops to zero. |
445 | */ | 447 | */ |
446 | int dev_uc_del(struct net_device *dev, unsigned char *addr) | 448 | int dev_uc_del(struct net_device *dev, const unsigned char *addr) |
447 | { | 449 | { |
448 | int err; | 450 | int err; |
449 | 451 | ||
@@ -543,7 +545,7 @@ EXPORT_SYMBOL(dev_uc_init); | |||
543 | * @dev: device | 545 | * @dev: device |
544 | * @addr: address to add | 546 | * @addr: address to add |
545 | */ | 547 | */ |
546 | int dev_mc_add_excl(struct net_device *dev, unsigned char *addr) | 548 | int dev_mc_add_excl(struct net_device *dev, const unsigned char *addr) |
547 | { | 549 | { |
548 | struct netdev_hw_addr *ha; | 550 | struct netdev_hw_addr *ha; |
549 | int err; | 551 | int err; |
@@ -566,7 +568,7 @@ out: | |||
566 | } | 568 | } |
567 | EXPORT_SYMBOL(dev_mc_add_excl); | 569 | EXPORT_SYMBOL(dev_mc_add_excl); |
568 | 570 | ||
569 | static int __dev_mc_add(struct net_device *dev, unsigned char *addr, | 571 | static int __dev_mc_add(struct net_device *dev, const unsigned char *addr, |
570 | bool global) | 572 | bool global) |
571 | { | 573 | { |
572 | int err; | 574 | int err; |
@@ -587,7 +589,7 @@ static int __dev_mc_add(struct net_device *dev, unsigned char *addr, | |||
587 | * Add a multicast address to the device or increase | 589 | * Add a multicast address to the device or increase |
588 | * the reference count if it already exists. | 590 | * the reference count if it already exists. |
589 | */ | 591 | */ |
590 | int dev_mc_add(struct net_device *dev, unsigned char *addr) | 592 | int dev_mc_add(struct net_device *dev, const unsigned char *addr) |
591 | { | 593 | { |
592 | return __dev_mc_add(dev, addr, false); | 594 | return __dev_mc_add(dev, addr, false); |
593 | } | 595 | } |
@@ -600,13 +602,13 @@ EXPORT_SYMBOL(dev_mc_add); | |||
600 | * | 602 | * |
601 | * Add a global multicast address to the device. | 603 | * Add a global multicast address to the device. |
602 | */ | 604 | */ |
603 | int dev_mc_add_global(struct net_device *dev, unsigned char *addr) | 605 | int dev_mc_add_global(struct net_device *dev, const unsigned char *addr) |
604 | { | 606 | { |
605 | return __dev_mc_add(dev, addr, true); | 607 | return __dev_mc_add(dev, addr, true); |
606 | } | 608 | } |
607 | EXPORT_SYMBOL(dev_mc_add_global); | 609 | EXPORT_SYMBOL(dev_mc_add_global); |
608 | 610 | ||
609 | static int __dev_mc_del(struct net_device *dev, unsigned char *addr, | 611 | static int __dev_mc_del(struct net_device *dev, const unsigned char *addr, |
610 | bool global) | 612 | bool global) |
611 | { | 613 | { |
612 | int err; | 614 | int err; |
@@ -628,7 +630,7 @@ static int __dev_mc_del(struct net_device *dev, unsigned char *addr, | |||
628 | * Release reference to a multicast address and remove it | 630 | * Release reference to a multicast address and remove it |
629 | * from the device if the reference count drops to zero. | 631 | * from the device if the reference count drops to zero. |
630 | */ | 632 | */ |
631 | int dev_mc_del(struct net_device *dev, unsigned char *addr) | 633 | int dev_mc_del(struct net_device *dev, const unsigned char *addr) |
632 | { | 634 | { |
633 | return __dev_mc_del(dev, addr, false); | 635 | return __dev_mc_del(dev, addr, false); |
634 | } | 636 | } |
@@ -642,7 +644,7 @@ EXPORT_SYMBOL(dev_mc_del); | |||
642 | * Release reference to a multicast address and remove it | 644 | * Release reference to a multicast address and remove it |
643 | * from the device if the reference count drops to zero. | 645 | * from the device if the reference count drops to zero. |
644 | */ | 646 | */ |
645 | int dev_mc_del_global(struct net_device *dev, unsigned char *addr) | 647 | int dev_mc_del_global(struct net_device *dev, const unsigned char *addr) |
646 | { | 648 | { |
647 | return __dev_mc_del(dev, addr, true); | 649 | return __dev_mc_del(dev, addr, true); |
648 | } | 650 | } |