aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm/mpoa_caches.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/mpoa_caches.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/mpoa_caches.c')
-rw-r--r--net/atm/mpoa_caches.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
index 781ed1b9329d..fbf13cdcf46e 100644
--- a/net/atm/mpoa_caches.c
+++ b/net/atm/mpoa_caches.c
@@ -87,7 +87,6 @@ static in_cache_entry *in_cache_get_by_vcc(struct atm_vcc *vcc,
87static in_cache_entry *in_cache_add_entry(uint32_t dst_ip, 87static in_cache_entry *in_cache_add_entry(uint32_t dst_ip,
88 struct mpoa_client *client) 88 struct mpoa_client *client)
89{ 89{
90 unsigned char *ip __attribute__ ((unused)) = (unsigned char *)&dst_ip;
91 in_cache_entry* entry = kmalloc(sizeof(in_cache_entry), GFP_KERNEL); 90 in_cache_entry* entry = kmalloc(sizeof(in_cache_entry), GFP_KERNEL);
92 91
93 if (entry == NULL) { 92 if (entry == NULL) {
@@ -95,7 +94,7 @@ static in_cache_entry *in_cache_add_entry(uint32_t dst_ip,
95 return NULL; 94 return NULL;
96 } 95 }
97 96
98 dprintk("mpoa: mpoa_caches.c: adding an ingress entry, ip = %u.%u.%u.%u\n", ip[0], ip[1], ip[2], ip[3]); 97 dprintk("mpoa: mpoa_caches.c: adding an ingress entry, ip = %u.%u.%u.%u\n", NIPQUAD(dst_ip));
99 memset(entry,0,sizeof(in_cache_entry)); 98 memset(entry,0,sizeof(in_cache_entry));
100 99
101 atomic_set(&entry->use, 1); 100 atomic_set(&entry->use, 1);
@@ -152,10 +151,7 @@ static int cache_hit(in_cache_entry *entry, struct mpoa_client *mpc)
152 151
153 if( entry->count > mpc->parameters.mpc_p1 && 152 if( entry->count > mpc->parameters.mpc_p1 &&
154 entry->entry_state == INGRESS_INVALID){ 153 entry->entry_state == INGRESS_INVALID){
155 unsigned char *ip __attribute__ ((unused)) = 154 dprintk("mpoa: (%s) mpoa_caches.c: threshold exceeded for ip %u.%u.%u.%u, sending MPOA res req\n", mpc->dev->name, NIPQUAD(entry->ctrl_info.in_dst_ip));
156 (unsigned char *)&entry->ctrl_info.in_dst_ip;
157
158 dprintk("mpoa: (%s) mpoa_caches.c: threshold exceeded for ip %u.%u.%u.%u, sending MPOA res req\n", mpc->dev->name, ip[0], ip[1], ip[2], ip[3]);
159 entry->entry_state = INGRESS_RESOLVING; 155 entry->entry_state = INGRESS_RESOLVING;
160 msg.type = SND_MPOA_RES_RQST; 156 msg.type = SND_MPOA_RES_RQST;
161 memcpy(msg.MPS_ctrl, mpc->mps_ctrl_addr, ATM_ESA_LEN ); 157 memcpy(msg.MPS_ctrl, mpc->mps_ctrl_addr, ATM_ESA_LEN );
@@ -187,11 +183,9 @@ static void in_cache_remove_entry(in_cache_entry *entry,
187{ 183{
188 struct atm_vcc *vcc; 184 struct atm_vcc *vcc;
189 struct k_message msg; 185 struct k_message msg;
190 unsigned char *ip;
191 186
192 vcc = entry->shortcut; 187 vcc = entry->shortcut;
193 ip = (unsigned char *)&entry->ctrl_info.in_dst_ip; 188 dprintk("mpoa: mpoa_caches.c: removing an ingress entry, ip = %u.%u.%u.%u\n",NIPQUAD(entry->ctrl_info.in_dst_ip));
194 dprintk("mpoa: mpoa_caches.c: removing an ingress entry, ip = %u.%u.%u.%u\n",ip[0], ip[1], ip[2], ip[3]);
195 189
196 if (entry->prev != NULL) 190 if (entry->prev != NULL)
197 entry->prev->next = entry->next; 191 entry->prev->next = entry->next;