diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-10-30 01:43:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-30 01:43:33 -0400 |
commit | 8cf14e38372d84ea09ba45fb60b61f6e36c18546 (patch) | |
tree | 56f777828ff7109808407b8a348c31ac74d5b558 /drivers | |
parent | 9edb8bb68b5ea63061ba833831b00c229ac9fbd2 (diff) |
net: easy removals of HIPQUAD using %pI4 format
As a bonus, removes some unnecessary byteswapping.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/hw/nes/nes.c | 11 | ||||
-rw-r--r-- | drivers/isdn/i4l/isdn_net.c | 34 | ||||
-rw-r--r-- | drivers/net/bonding/bond_main.c | 4 |
3 files changed, 18 insertions, 31 deletions
diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c index 231ed708da68..fb7d243b1a23 100644 --- a/drivers/infiniband/hw/nes/nes.c +++ b/drivers/infiniband/hw/nes/nes.c | |||
@@ -138,14 +138,9 @@ static int nes_inetaddr_event(struct notifier_block *notifier, | |||
138 | struct nes_device *nesdev; | 138 | struct nes_device *nesdev; |
139 | struct net_device *netdev; | 139 | struct net_device *netdev; |
140 | struct nes_vnic *nesvnic; | 140 | struct nes_vnic *nesvnic; |
141 | unsigned int addr; | 141 | |
142 | unsigned int mask; | 142 | nes_debug(NES_DBG_NETDEV, "nes_inetaddr_event: ip address %pI4, netmask %pI4.\n", |
143 | 143 | &ifa->ifa_address, &ifa->ifa_mask); | |
144 | addr = ntohl(ifa->ifa_address); | ||
145 | mask = ntohl(ifa->ifa_mask); | ||
146 | nes_debug(NES_DBG_NETDEV, "nes_inetaddr_event: ip address " NIPQUAD_FMT | ||
147 | ", netmask " NIPQUAD_FMT ".\n", | ||
148 | HIPQUAD(addr), HIPQUAD(mask)); | ||
149 | list_for_each_entry(nesdev, &nes_dev_list, list) { | 144 | list_for_each_entry(nesdev, &nes_dev_list, list) { |
150 | nes_debug(NES_DBG_NETDEV, "Nesdev list entry = 0x%p. (%s)\n", | 145 | nes_debug(NES_DBG_NETDEV, "Nesdev list entry = 0x%p. (%s)\n", |
151 | nesdev, nesdev->netdev[0]->name); | 146 | nesdev, nesdev->netdev[0]->name); |
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index bb904a0a98bd..60c82d7b12a8 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c | |||
@@ -1654,9 +1654,10 @@ isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb) | |||
1654 | unsigned char *p; | 1654 | unsigned char *p; |
1655 | int period; | 1655 | int period; |
1656 | u32 code; | 1656 | u32 code; |
1657 | u32 my_seq, addr; | 1657 | u32 my_seq; |
1658 | u32 your_seq, mask; | 1658 | u32 your_seq; |
1659 | u32 local; | 1659 | __be32 local; |
1660 | __be32 *addr, *mask; | ||
1660 | u16 unused; | 1661 | u16 unused; |
1661 | 1662 | ||
1662 | if (skb->len < 14) | 1663 | if (skb->len < 14) |
@@ -1671,27 +1672,20 @@ isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb) | |||
1671 | isdn_net_ciscohdlck_slarp_send_reply(lp); | 1672 | isdn_net_ciscohdlck_slarp_send_reply(lp); |
1672 | break; | 1673 | break; |
1673 | case CISCO_SLARP_REPLY: | 1674 | case CISCO_SLARP_REPLY: |
1674 | addr = ntohl(*(u32 *)p); | 1675 | addr = (__be32 *)p; |
1675 | mask = ntohl(*(u32 *)(p+4)); | 1676 | mask = (__be32 *)(p + 4); |
1676 | if (mask != 0xfffffffc) | 1677 | if (*mask != cpu_to_be32(0xfffffffc)) |
1677 | goto slarp_reply_out; | 1678 | goto slarp_reply_out; |
1678 | if ((addr & 3) == 0 || (addr & 3) == 3) | 1679 | if ((*addr & cpu_to_be32(3)) == cpu_to_be32(0) || |
1680 | (*addr & cpu_to_be32(3)) == cpu_to_be32(3)) | ||
1679 | goto slarp_reply_out; | 1681 | goto slarp_reply_out; |
1680 | local = addr ^ 3; | 1682 | local = *addr ^ cpu_to_be32(3); |
1681 | printk(KERN_INFO "%s: got slarp reply: " | 1683 | printk(KERN_INFO "%s: got slarp reply: remote ip: %pI4, local ip: %pI4 mask: %pI4\n", |
1682 | "remote ip: %d.%d.%d.%d, " | 1684 | lp->netdev->dev->name, addr, &local, mask); |
1683 | "local ip: %d.%d.%d.%d " | ||
1684 | "mask: %d.%d.%d.%d\n", | ||
1685 | lp->netdev->dev->name, | ||
1686 | HIPQUAD(addr), | ||
1687 | HIPQUAD(local), | ||
1688 | HIPQUAD(mask)); | ||
1689 | break; | 1685 | break; |
1690 | slarp_reply_out: | 1686 | slarp_reply_out: |
1691 | printk(KERN_INFO "%s: got invalid slarp " | 1687 | printk(KERN_INFO "%s: got invalid slarp reply (%pI4/%pI4) - ignored\n", |
1692 | "reply (%d.%d.%d.%d/%d.%d.%d.%d) " | 1688 | lp->netdev->dev->name, addr, mask); |
1693 | "- ignored\n", lp->netdev->dev->name, | ||
1694 | HIPQUAD(addr), HIPQUAD(mask)); | ||
1695 | break; | 1689 | break; |
1696 | case CISCO_SLARP_KEEPALIVE: | 1690 | case CISCO_SLARP_KEEPALIVE: |
1697 | period = (int)((jiffies - lp->cisco_last_slarp_in | 1691 | period = (int)((jiffies - lp->cisco_last_slarp_in |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 36e89e310e8a..f2da031fd7ba 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -3221,7 +3221,6 @@ static void bond_info_show_master(struct seq_file *seq) | |||
3221 | struct bonding *bond = seq->private; | 3221 | struct bonding *bond = seq->private; |
3222 | struct slave *curr; | 3222 | struct slave *curr; |
3223 | int i; | 3223 | int i; |
3224 | u32 target; | ||
3225 | 3224 | ||
3226 | read_lock(&bond->curr_slave_lock); | 3225 | read_lock(&bond->curr_slave_lock); |
3227 | curr = bond->curr_active_slave; | 3226 | curr = bond->curr_active_slave; |
@@ -3275,8 +3274,7 @@ static void bond_info_show_master(struct seq_file *seq) | |||
3275 | continue; | 3274 | continue; |
3276 | if (printed) | 3275 | if (printed) |
3277 | seq_printf(seq, ","); | 3276 | seq_printf(seq, ","); |
3278 | target = ntohl(bond->params.arp_targets[i]); | 3277 | seq_printf(seq, " %pI4", &bond->params.arp_targets[i]); |
3279 | seq_printf(seq, " %d.%d.%d.%d", HIPQUAD(target)); | ||
3280 | printed = 1; | 3278 | printed = 1; |
3281 | } | 3279 | } |
3282 | seq_printf(seq, "\n"); | 3280 | seq_printf(seq, "\n"); |