diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-10-31 03:56:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-31 03:56:00 -0400 |
commit | 63779436ab4ad0867bcea53bf853b0004d7b895d (patch) | |
tree | bd4e49449eb852a54f62cc8bb1c807e26746dd43 | |
parent | 21454aaad30651ba0dcc16fe5271bc12ee21f132 (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>
-rw-r--r-- | drivers/firmware/iscsi_ibft.c | 3 | ||||
-rw-r--r-- | drivers/infiniband/hw/nes/nes_cm.c | 21 | ||||
-rw-r--r-- | drivers/infiniband/hw/nes/nes_utils.c | 5 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_verbs.c | 8 | ||||
-rw-r--r-- | drivers/net/bonding/bond_main.c | 22 | ||||
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 28 | ||||
-rw-r--r-- | drivers/scsi/iscsi_tcp.c | 2 | ||||
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 3 |
8 files changed, 42 insertions, 50 deletions
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c index acb82aff880..3ab3e4a41d6 100644 --- a/drivers/firmware/iscsi_ibft.c +++ b/drivers/firmware/iscsi_ibft.c | |||
@@ -284,8 +284,7 @@ static ssize_t sprintf_ipaddr(char *buf, u8 *ip) | |||
284 | /* | 284 | /* |
285 | * IPV4 | 285 | * IPV4 |
286 | */ | 286 | */ |
287 | str += sprintf(buf, NIPQUAD_FMT, ip[12], | 287 | str += sprintf(buf, "%pI4", ip + 12); |
288 | ip[13], ip[14], ip[15]); | ||
289 | } else { | 288 | } else { |
290 | /* | 289 | /* |
291 | * IPv6 | 290 | * IPv6 |
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 6058d05e975..2854a6f7fdf 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c | |||
@@ -823,8 +823,8 @@ static struct nes_cm_node *find_node(struct nes_cm_core *cm_core, | |||
823 | /* get a handle on the hte */ | 823 | /* get a handle on the hte */ |
824 | hte = &cm_core->connected_nodes; | 824 | hte = &cm_core->connected_nodes; |
825 | 825 | ||
826 | nes_debug(NES_DBG_CM, "Searching for an owner node: " NIPQUAD_FMT ":%x from core %p->%p\n", | 826 | nes_debug(NES_DBG_CM, "Searching for an owner node: %pI4:%x from core %p->%p\n", |
827 | HIPQUAD(loc_addr), loc_port, cm_core, hte); | 827 | &loc_addr, loc_port, cm_core, hte); |
828 | 828 | ||
829 | /* walk list and find cm_node associated with this session ID */ | 829 | /* walk list and find cm_node associated with this session ID */ |
830 | spin_lock_irqsave(&cm_core->ht_lock, flags); | 830 | spin_lock_irqsave(&cm_core->ht_lock, flags); |
@@ -873,8 +873,8 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core, | |||
873 | } | 873 | } |
874 | spin_unlock_irqrestore(&cm_core->listen_list_lock, flags); | 874 | spin_unlock_irqrestore(&cm_core->listen_list_lock, flags); |
875 | 875 | ||
876 | nes_debug(NES_DBG_CM, "Unable to find listener for " NIPQUAD_FMT ":%x\n", | 876 | nes_debug(NES_DBG_CM, "Unable to find listener for %pI4:%x\n", |
877 | HIPQUAD(dst_addr), dst_port); | 877 | &dst_addr, dst_port); |
878 | 878 | ||
879 | /* no listener */ | 879 | /* no listener */ |
880 | return NULL; | 880 | return NULL; |
@@ -1082,10 +1082,9 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core, | |||
1082 | cm_node->loc_port = cm_info->loc_port; | 1082 | cm_node->loc_port = cm_info->loc_port; |
1083 | cm_node->rem_port = cm_info->rem_port; | 1083 | cm_node->rem_port = cm_info->rem_port; |
1084 | cm_node->send_write0 = send_first; | 1084 | cm_node->send_write0 = send_first; |
1085 | nes_debug(NES_DBG_CM, "Make node addresses : loc = " NIPQUAD_FMT | 1085 | nes_debug(NES_DBG_CM, "Make node addresses : loc = %pI4:%x, rem = %pI4:%x\n", |
1086 | ":%x, rem = " NIPQUAD_FMT ":%x\n", | 1086 | &cm_node->loc_addr, cm_node->loc_port, |
1087 | HIPQUAD(cm_node->loc_addr), cm_node->loc_port, | 1087 | &cm_node->rem_addr, cm_node->rem_port); |
1088 | HIPQUAD(cm_node->rem_addr), cm_node->rem_port); | ||
1089 | cm_node->listener = listener; | 1088 | cm_node->listener = listener; |
1090 | cm_node->netdev = nesvnic->netdev; | 1089 | cm_node->netdev = nesvnic->netdev; |
1091 | cm_node->cm_id = cm_info->cm_id; | 1090 | cm_node->cm_id = cm_info->cm_id; |
@@ -2066,10 +2065,8 @@ static void mini_cm_recv_pkt(struct nes_cm_core *cm_core, | |||
2066 | nfo.rem_addr = ntohl(iph->saddr); | 2065 | nfo.rem_addr = ntohl(iph->saddr); |
2067 | nfo.rem_port = ntohs(tcph->source); | 2066 | nfo.rem_port = ntohs(tcph->source); |
2068 | 2067 | ||
2069 | nes_debug(NES_DBG_CM, "Received packet: dest=" NIPQUAD_FMT | 2068 | nes_debug(NES_DBG_CM, "Received packet: dest=%pI4:0x%04X src=%pI4:0x%04X\n", |
2070 | ":0x%04X src=" NIPQUAD_FMT ":0x%04X\n", | 2069 | &iph->daddr, tcph->dest, &iph->saddr, tcph->source); |
2071 | NIPQUAD(iph->daddr), tcph->dest, | ||
2072 | NIPQUAD(iph->saddr), tcph->source); | ||
2073 | 2070 | ||
2074 | do { | 2071 | do { |
2075 | cm_node = find_node(cm_core, | 2072 | cm_node = find_node(cm_core, |
diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c index fb8cbd71a2e..9f16f7a89ef 100644 --- a/drivers/infiniband/hw/nes/nes_utils.c +++ b/drivers/infiniband/hw/nes/nes_utils.c | |||
@@ -679,9 +679,8 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti | |||
679 | 679 | ||
680 | /* DELETE or RESOLVE */ | 680 | /* DELETE or RESOLVE */ |
681 | if (arp_index == nesadapter->arp_table_size) { | 681 | if (arp_index == nesadapter->arp_table_size) { |
682 | nes_debug(NES_DBG_NETDEV, "MAC for " NIPQUAD_FMT " not in ARP table - cannot %s\n", | 682 | nes_debug(NES_DBG_NETDEV, "MAC for %pI4 not in ARP table - cannot %s\n", |
683 | HIPQUAD(ip_addr), | 683 | &ip_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete"); |
684 | action == NES_ARP_RESOLVE ? "resolve" : "delete"); | ||
685 | return -1; | 684 | return -1; |
686 | } | 685 | } |
687 | 686 | ||
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 26ff6214a81..e418b960e33 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c | |||
@@ -515,14 +515,14 @@ int iser_connect(struct iser_conn *ib_conn, | |||
515 | struct sockaddr *src, *dst; | 515 | struct sockaddr *src, *dst; |
516 | int err = 0; | 516 | int err = 0; |
517 | 517 | ||
518 | sprintf(ib_conn->name,"%d.%d.%d.%d:%d", | 518 | sprintf(ib_conn->name, "%pI4:%d", |
519 | NIPQUAD(dst_addr->sin_addr.s_addr), dst_addr->sin_port); | 519 | &dst_addr->sin_addr.s_addr, dst_addr->sin_port); |
520 | 520 | ||
521 | /* the device is known only --after-- address resolution */ | 521 | /* the device is known only --after-- address resolution */ |
522 | ib_conn->device = NULL; | 522 | ib_conn->device = NULL; |
523 | 523 | ||
524 | iser_err("connecting to: %d.%d.%d.%d, port 0x%x\n", | 524 | iser_err("connecting to: %pI4, port 0x%x\n", |
525 | NIPQUAD(dst_addr->sin_addr), dst_addr->sin_port); | 525 | &dst_addr->sin_addr, dst_addr->sin_port); |
526 | 526 | ||
527 | ib_conn->state = ISER_CONN_PENDING; | 527 | ib_conn->state = ISER_CONN_PENDING; |
528 | 528 | ||
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index fd9028d7c06..56c823c175f 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 99c79a4e080..296a865b75d 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 | } |
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index 24d09028a27..e11bce6ab63 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c | |||
@@ -1601,7 +1601,7 @@ static int iscsi_tcp_get_addr(struct iscsi_conn *conn, struct socket *sock, | |||
1601 | case AF_INET: | 1601 | case AF_INET: |
1602 | sin = (struct sockaddr_in *)addr; | 1602 | sin = (struct sockaddr_in *)addr; |
1603 | spin_lock_bh(&conn->session->lock); | 1603 | spin_lock_bh(&conn->session->lock); |
1604 | sprintf(buf, NIPQUAD_FMT, NIPQUAD(sin->sin_addr.s_addr)); | 1604 | sprintf(buf, "%pI4", &sin->sin_addr.s_addr); |
1605 | *port = be16_to_cpu(sin->sin_port); | 1605 | *port = be16_to_cpu(sin->sin_port); |
1606 | spin_unlock_bh(&conn->session->lock); | 1606 | spin_unlock_bh(&conn->session->lock); |
1607 | break; | 1607 | break; |
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index db7ea3bb4e8..eb3a414b189 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
@@ -206,8 +206,7 @@ static int qla4xxx_conn_get_param(struct iscsi_cls_conn *conn, | |||
206 | break; | 206 | break; |
207 | case ISCSI_PARAM_CONN_ADDRESS: | 207 | case ISCSI_PARAM_CONN_ADDRESS: |
208 | /* TODO: what are the ipv6 bits */ | 208 | /* TODO: what are the ipv6 bits */ |
209 | len = sprintf(buf, "%u.%u.%u.%u\n", | 209 | len = sprintf(buf, "%pI4\n", &ddb_entry->ip_addr); |
210 | NIPQUAD(ddb_entry->ip_addr)); | ||
211 | break; | 210 | break; |
212 | default: | 211 | default: |
213 | return -ENOSYS; | 212 | return -ENOSYS; |