aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-10-31 03:56:00 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-31 03:56:00 -0400
commit63779436ab4ad0867bcea53bf853b0004d7b895d (patch)
treebd4e49449eb852a54f62cc8bb1c807e26746dd43 /drivers/net/bonding
parent21454aaad30651ba0dcc16fe5271bc12ee21f132 (diff)
drivers: replace NIPQUAD()
Using NIPQUAD() with NIPQUAD_FMT, %d.%d.%d.%d or %u.%u.%u.%u can be replaced with %pI4 Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c22
-rw-r--r--drivers/net/bonding/bond_sysfs.c28
2 files changed, 24 insertions, 26 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index fd9028d7c06e..56c823c175fe 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2585,8 +2585,8 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
2585 if (rv) { 2585 if (rv) {
2586 if (net_ratelimit()) { 2586 if (net_ratelimit()) {
2587 printk(KERN_WARNING DRV_NAME 2587 printk(KERN_WARNING DRV_NAME
2588 ": %s: no route to arp_ip_target %u.%u.%u.%u\n", 2588 ": %s: no route to arp_ip_target %pI4\n",
2589 bond->dev->name, NIPQUAD(fl.fl4_dst)); 2589 bond->dev->name, &fl.fl4_dst);
2590 } 2590 }
2591 continue; 2591 continue;
2592 } 2592 }
@@ -2622,8 +2622,8 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
2622 2622
2623 if (net_ratelimit()) { 2623 if (net_ratelimit()) {
2624 printk(KERN_WARNING DRV_NAME 2624 printk(KERN_WARNING DRV_NAME
2625 ": %s: no path to arp_ip_target %u.%u.%u.%u via rt.dev %s\n", 2625 ": %s: no path to arp_ip_target %pI4 via rt.dev %s\n",
2626 bond->dev->name, NIPQUAD(fl.fl4_dst), 2626 bond->dev->name, &fl.fl4_dst,
2627 rt->u.dst.dev ? rt->u.dst.dev->name : "NULL"); 2627 rt->u.dst.dev ? rt->u.dst.dev->name : "NULL");
2628 } 2628 }
2629 ip_rt_put(rt); 2629 ip_rt_put(rt);
@@ -2672,10 +2672,8 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
2672 2672
2673 targets = bond->params.arp_targets; 2673 targets = bond->params.arp_targets;
2674 for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) { 2674 for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) {
2675 dprintk("bva: sip %u.%u.%u.%u tip %u.%u.%u.%u t[%d] " 2675 dprintk("bva: sip %pI4 tip %pI4 t[%d] %pI4 bhti(tip) %d\n",
2676 "%u.%u.%u.%u bhti(tip) %d\n", 2676 &sip, &tip, i, &targets[i], bond_has_this_ip(bond, tip));
2677 NIPQUAD(sip), NIPQUAD(tip), i, NIPQUAD(targets[i]),
2678 bond_has_this_ip(bond, tip));
2679 if (sip == targets[i]) { 2677 if (sip == targets[i]) {
2680 if (bond_has_this_ip(bond, tip)) 2678 if (bond_has_this_ip(bond, tip))
2681 slave->last_arp_rx = jiffies; 2679 slave->last_arp_rx = jiffies;
@@ -2727,10 +2725,10 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack
2727 arp_ptr += 4 + dev->addr_len; 2725 arp_ptr += 4 + dev->addr_len;
2728 memcpy(&tip, arp_ptr, 4); 2726 memcpy(&tip, arp_ptr, 4);
2729 2727
2730 dprintk("bond_arp_rcv: %s %s/%d av %d sv %d sip %u.%u.%u.%u" 2728 dprintk("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n",
2731 " tip %u.%u.%u.%u\n", bond->dev->name, slave->dev->name, 2729 bond->dev->name, slave->dev->name, slave->state,
2732 slave->state, bond->params.arp_validate, 2730 bond->params.arp_validate, slave_do_arp_validate(bond, slave),
2733 slave_do_arp_validate(bond, slave), NIPQUAD(sip), NIPQUAD(tip)); 2731 &sip, &tip);
2734 2732
2735 /* 2733 /*
2736 * Backup slaves won't see the ARP reply, but do come through 2734 * Backup slaves won't see the ARP reply, but do come through
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 99c79a4e0806..296a865b75d2 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -672,8 +672,8 @@ static ssize_t bonding_show_arp_targets(struct device *d,
672 672
673 for (i = 0; i < BOND_MAX_ARP_TARGETS; i++) { 673 for (i = 0; i < BOND_MAX_ARP_TARGETS; i++) {
674 if (bond->params.arp_targets[i]) 674 if (bond->params.arp_targets[i])
675 res += sprintf(buf + res, "%u.%u.%u.%u ", 675 res += sprintf(buf + res, "%pI4 ",
676 NIPQUAD(bond->params.arp_targets[i])); 676 &bond->params.arp_targets[i]);
677 } 677 }
678 if (res) 678 if (res)
679 buf[res-1] = '\n'; /* eat the leftover space */ 679 buf[res-1] = '\n'; /* eat the leftover space */
@@ -695,8 +695,8 @@ static ssize_t bonding_store_arp_targets(struct device *d,
695 if (buf[0] == '+') { 695 if (buf[0] == '+') {
696 if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) { 696 if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) {
697 printk(KERN_ERR DRV_NAME 697 printk(KERN_ERR DRV_NAME
698 ": %s: invalid ARP target %u.%u.%u.%u specified for addition\n", 698 ": %s: invalid ARP target %pI4 specified for addition\n",
699 bond->dev->name, NIPQUAD(newtarget)); 699 bond->dev->name, &newtarget);
700 ret = -EINVAL; 700 ret = -EINVAL;
701 goto out; 701 goto out;
702 } 702 }
@@ -704,8 +704,8 @@ static ssize_t bonding_store_arp_targets(struct device *d,
704 for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) { 704 for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) {
705 if (targets[i] == newtarget) { /* duplicate */ 705 if (targets[i] == newtarget) { /* duplicate */
706 printk(KERN_ERR DRV_NAME 706 printk(KERN_ERR DRV_NAME
707 ": %s: ARP target %u.%u.%u.%u is already present\n", 707 ": %s: ARP target %pI4 is already present\n",
708 bond->dev->name, NIPQUAD(newtarget)); 708 bond->dev->name, &newtarget);
709 if (done) 709 if (done)
710 targets[i] = 0; 710 targets[i] = 0;
711 ret = -EINVAL; 711 ret = -EINVAL;
@@ -713,8 +713,8 @@ static ssize_t bonding_store_arp_targets(struct device *d,
713 } 713 }
714 if (targets[i] == 0 && !done) { 714 if (targets[i] == 0 && !done) {
715 printk(KERN_INFO DRV_NAME 715 printk(KERN_INFO DRV_NAME
716 ": %s: adding ARP target %d.%d.%d.%d.\n", 716 ": %s: adding ARP target %pI4.\n",
717 bond->dev->name, NIPQUAD(newtarget)); 717 bond->dev->name, &newtarget);
718 done = 1; 718 done = 1;
719 targets[i] = newtarget; 719 targets[i] = newtarget;
720 } 720 }
@@ -731,8 +731,8 @@ static ssize_t bonding_store_arp_targets(struct device *d,
731 else if (buf[0] == '-') { 731 else if (buf[0] == '-') {
732 if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) { 732 if ((newtarget == 0) || (newtarget == htonl(INADDR_BROADCAST))) {
733 printk(KERN_ERR DRV_NAME 733 printk(KERN_ERR DRV_NAME
734 ": %s: invalid ARP target %d.%d.%d.%d specified for removal\n", 734 ": %s: invalid ARP target %pI4 specified for removal\n",
735 bond->dev->name, NIPQUAD(newtarget)); 735 bond->dev->name, &newtarget);
736 ret = -EINVAL; 736 ret = -EINVAL;
737 goto out; 737 goto out;
738 } 738 }
@@ -740,16 +740,16 @@ static ssize_t bonding_store_arp_targets(struct device *d,
740 for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) { 740 for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) {
741 if (targets[i] == newtarget) { 741 if (targets[i] == newtarget) {
742 printk(KERN_INFO DRV_NAME 742 printk(KERN_INFO DRV_NAME
743 ": %s: removing ARP target %d.%d.%d.%d.\n", 743 ": %s: removing ARP target %pI4.\n",
744 bond->dev->name, NIPQUAD(newtarget)); 744 bond->dev->name, &newtarget);
745 targets[i] = 0; 745 targets[i] = 0;
746 done = 1; 746 done = 1;
747 } 747 }
748 } 748 }
749 if (!done) { 749 if (!done) {
750 printk(KERN_INFO DRV_NAME 750 printk(KERN_INFO DRV_NAME
751 ": %s: unable to remove nonexistent ARP target %d.%d.%d.%d.\n", 751 ": %s: unable to remove nonexistent ARP target %pI4.\n",
752 bond->dev->name, NIPQUAD(newtarget)); 752 bond->dev->name, &newtarget);
753 ret = -EINVAL; 753 ret = -EINVAL;
754 goto out; 754 goto out;
755 } 755 }