diff options
author | stephen hemminger <shemminger@vyatta.com> | 2011-09-16 07:04:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-09-16 19:20:20 -0400 |
commit | d97a077a15ae21e161e74def7762caa99200e4cf (patch) | |
tree | 2c017dad747ab7d1ddb5fc090d1d3b1038f0c33f /net/lapb | |
parent | 026359bc6eddfdc2d2e684bf0b51691649b90f33 (diff) |
wan: make LAPB callbacks const
This is compile tested only.
Suggested by dumpster diving in PAX.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/lapb')
-rw-r--r-- | net/lapb/lapb_iface.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c index 956b7e47dc52..8d0324bac01c 100644 --- a/net/lapb/lapb_iface.c +++ b/net/lapb/lapb_iface.c | |||
@@ -139,7 +139,8 @@ out: | |||
139 | return lapb; | 139 | return lapb; |
140 | } | 140 | } |
141 | 141 | ||
142 | int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks) | 142 | int lapb_register(struct net_device *dev, |
143 | const struct lapb_register_struct *callbacks) | ||
143 | { | 144 | { |
144 | struct lapb_cb *lapb; | 145 | struct lapb_cb *lapb; |
145 | int rc = LAPB_BADTOKEN; | 146 | int rc = LAPB_BADTOKEN; |
@@ -158,7 +159,7 @@ int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks | |||
158 | goto out; | 159 | goto out; |
159 | 160 | ||
160 | lapb->dev = dev; | 161 | lapb->dev = dev; |
161 | lapb->callbacks = *callbacks; | 162 | lapb->callbacks = callbacks; |
162 | 163 | ||
163 | __lapb_insert_cb(lapb); | 164 | __lapb_insert_cb(lapb); |
164 | 165 | ||
@@ -380,32 +381,32 @@ int lapb_data_received(struct net_device *dev, struct sk_buff *skb) | |||
380 | 381 | ||
381 | void lapb_connect_confirmation(struct lapb_cb *lapb, int reason) | 382 | void lapb_connect_confirmation(struct lapb_cb *lapb, int reason) |
382 | { | 383 | { |
383 | if (lapb->callbacks.connect_confirmation) | 384 | if (lapb->callbacks->connect_confirmation) |
384 | lapb->callbacks.connect_confirmation(lapb->dev, reason); | 385 | lapb->callbacks->connect_confirmation(lapb->dev, reason); |
385 | } | 386 | } |
386 | 387 | ||
387 | void lapb_connect_indication(struct lapb_cb *lapb, int reason) | 388 | void lapb_connect_indication(struct lapb_cb *lapb, int reason) |
388 | { | 389 | { |
389 | if (lapb->callbacks.connect_indication) | 390 | if (lapb->callbacks->connect_indication) |
390 | lapb->callbacks.connect_indication(lapb->dev, reason); | 391 | lapb->callbacks->connect_indication(lapb->dev, reason); |
391 | } | 392 | } |
392 | 393 | ||
393 | void lapb_disconnect_confirmation(struct lapb_cb *lapb, int reason) | 394 | void lapb_disconnect_confirmation(struct lapb_cb *lapb, int reason) |
394 | { | 395 | { |
395 | if (lapb->callbacks.disconnect_confirmation) | 396 | if (lapb->callbacks->disconnect_confirmation) |
396 | lapb->callbacks.disconnect_confirmation(lapb->dev, reason); | 397 | lapb->callbacks->disconnect_confirmation(lapb->dev, reason); |
397 | } | 398 | } |
398 | 399 | ||
399 | void lapb_disconnect_indication(struct lapb_cb *lapb, int reason) | 400 | void lapb_disconnect_indication(struct lapb_cb *lapb, int reason) |
400 | { | 401 | { |
401 | if (lapb->callbacks.disconnect_indication) | 402 | if (lapb->callbacks->disconnect_indication) |
402 | lapb->callbacks.disconnect_indication(lapb->dev, reason); | 403 | lapb->callbacks->disconnect_indication(lapb->dev, reason); |
403 | } | 404 | } |
404 | 405 | ||
405 | int lapb_data_indication(struct lapb_cb *lapb, struct sk_buff *skb) | 406 | int lapb_data_indication(struct lapb_cb *lapb, struct sk_buff *skb) |
406 | { | 407 | { |
407 | if (lapb->callbacks.data_indication) | 408 | if (lapb->callbacks->data_indication) |
408 | return lapb->callbacks.data_indication(lapb->dev, skb); | 409 | return lapb->callbacks->data_indication(lapb->dev, skb); |
409 | 410 | ||
410 | kfree_skb(skb); | 411 | kfree_skb(skb); |
411 | return NET_RX_SUCCESS; /* For now; must be != NET_RX_DROP */ | 412 | return NET_RX_SUCCESS; /* For now; must be != NET_RX_DROP */ |
@@ -415,8 +416,8 @@ int lapb_data_transmit(struct lapb_cb *lapb, struct sk_buff *skb) | |||
415 | { | 416 | { |
416 | int used = 0; | 417 | int used = 0; |
417 | 418 | ||
418 | if (lapb->callbacks.data_transmit) { | 419 | if (lapb->callbacks->data_transmit) { |
419 | lapb->callbacks.data_transmit(lapb->dev, skb); | 420 | lapb->callbacks->data_transmit(lapb->dev, skb); |
420 | used = 1; | 421 | used = 1; |
421 | } | 422 | } |
422 | 423 | ||