aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm/mpc.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-09-27 00:23:43 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-28 20:54:00 -0400
commitb4229934bd11e1dd03d433072ef3871915fc5e4f (patch)
treeedd1ddcd326ae2fd9183528d1fb0c95abcc38f91 /net/atm/mpc.c
parent0ac0760a57a6b1eb75c21a590e578be5dfc2f88b (diff)
[ATM]: use NIPQUAD instead of open-coding it
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm/mpc.c')
-rw-r--r--net/atm/mpc.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index b87c2a88bdce..0d2b994af511 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -560,7 +560,6 @@ static int atm_mpoa_vcc_attach(struct atm_vcc *vcc, void __user *arg)
560 struct atmmpc_ioc ioc_data; 560 struct atmmpc_ioc ioc_data;
561 in_cache_entry *in_entry; 561 in_cache_entry *in_entry;
562 uint32_t ipaddr; 562 uint32_t ipaddr;
563 unsigned char *ip;
564 563
565 bytes_left = copy_from_user(&ioc_data, arg, sizeof(struct atmmpc_ioc)); 564 bytes_left = copy_from_user(&ioc_data, arg, sizeof(struct atmmpc_ioc));
566 if (bytes_left != 0) { 565 if (bytes_left != 0) {
@@ -583,9 +582,8 @@ static int atm_mpoa_vcc_attach(struct atm_vcc *vcc, void __user *arg)
583 if (in_entry != NULL) mpc->in_ops->put(in_entry); 582 if (in_entry != NULL) mpc->in_ops->put(in_entry);
584 return -EINVAL; 583 return -EINVAL;
585 } 584 }
586 ip = (unsigned char*)&in_entry->ctrl_info.in_dst_ip;
587 printk("mpoa: (%s) mpc_vcc_attach: attaching ingress SVC, entry = %u.%u.%u.%u\n", 585 printk("mpoa: (%s) mpc_vcc_attach: attaching ingress SVC, entry = %u.%u.%u.%u\n",
588 mpc->dev->name, ip[0], ip[1], ip[2], ip[3]); 586 mpc->dev->name, NIPQUAD(in_entry->ctrl_info.in_dst_ip));
589 in_entry->shortcut = vcc; 587 in_entry->shortcut = vcc;
590 mpc->in_ops->put(in_entry); 588 mpc->in_ops->put(in_entry);
591 } else { 589 } else {
@@ -616,10 +614,8 @@ static void mpc_vcc_close(struct atm_vcc *vcc, struct net_device *dev)
616 dprintk("mpoa: (%s) mpc_vcc_close:\n", dev->name); 614 dprintk("mpoa: (%s) mpc_vcc_close:\n", dev->name);
617 in_entry = mpc->in_ops->get_by_vcc(vcc, mpc); 615 in_entry = mpc->in_ops->get_by_vcc(vcc, mpc);
618 if (in_entry) { 616 if (in_entry) {
619 unsigned char *ip __attribute__ ((unused)) =
620 (unsigned char *)&in_entry->ctrl_info.in_dst_ip;
621 dprintk("mpoa: (%s) mpc_vcc_close: ingress SVC closed ip = %u.%u.%u.%u\n", 617 dprintk("mpoa: (%s) mpc_vcc_close: ingress SVC closed ip = %u.%u.%u.%u\n",
622 mpc->dev->name, ip[0], ip[1], ip[2], ip[3]); 618 mpc->dev->name, NIPQUAD(in_entry->ctrl_info.in_dst_ip));
623 in_entry->shortcut = NULL; 619 in_entry->shortcut = NULL;
624 mpc->in_ops->put(in_entry); 620 mpc->in_ops->put(in_entry);
625 } 621 }
@@ -1154,18 +1150,17 @@ static void ingress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)
1154{ 1150{
1155 uint32_t dst_ip = msg->content.in_info.in_dst_ip; 1151 uint32_t dst_ip = msg->content.in_info.in_dst_ip;
1156 uint32_t mask = msg->ip_mask; 1152 uint32_t mask = msg->ip_mask;
1157 unsigned char *ip = (unsigned char *)&dst_ip;
1158 in_cache_entry *entry = mpc->in_ops->get_with_mask(dst_ip, mpc, mask); 1153 in_cache_entry *entry = mpc->in_ops->get_with_mask(dst_ip, mpc, mask);
1159 1154
1160 if(entry == NULL){ 1155 if(entry == NULL){
1161 printk("mpoa: (%s) ingress_purge_rcvd: purge for a non-existing entry, ", mpc->dev->name); 1156 printk("mpoa: (%s) ingress_purge_rcvd: purge for a non-existing entry, ", mpc->dev->name);
1162 printk("ip = %u.%u.%u.%u\n", ip[0], ip[1], ip[2], ip[3]); 1157 printk("ip = %u.%u.%u.%u\n", NIPQUAD(dst_ip));
1163 return; 1158 return;
1164 } 1159 }
1165 1160
1166 do { 1161 do {
1167 dprintk("mpoa: (%s) ingress_purge_rcvd: removing an ingress entry, ip = %u.%u.%u.%u\n" , 1162 dprintk("mpoa: (%s) ingress_purge_rcvd: removing an ingress entry, ip = %u.%u.%u.%u\n" ,
1168 mpc->dev->name, ip[0], ip[1], ip[2], ip[3]); 1163 mpc->dev->name, NIPQUAD(dst_ip));
1169 write_lock_bh(&mpc->ingress_lock); 1164 write_lock_bh(&mpc->ingress_lock);
1170 mpc->in_ops->remove_entry(entry, mpc); 1165 mpc->in_ops->remove_entry(entry, mpc);
1171 write_unlock_bh(&mpc->ingress_lock); 1166 write_unlock_bh(&mpc->ingress_lock);