aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>2011-11-22 07:51:56 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-26 16:40:30 -0500
commit49f5ed4250c757cb19d953fcac2737a35ca14d76 (patch)
tree065c6a559b1b8b0a81f62f100804694a05659484
parent021ac8d387594bdf51d9a279b2f9e9defb614c9b (diff)
atm: eliminate atm_guess_pdu2truesize()
Signed-off-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/atm/iphase.c4
-rw-r--r--include/linux/atmdev.h10
-rw-r--r--net/atm/atm_misc.c2
3 files changed, 3 insertions, 13 deletions
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 3d0c2b0fed9c..9e373ba20308 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -1320,8 +1320,8 @@ static void rx_dle_intr(struct atm_dev *dev)
1320 if (ia_vcc == NULL) 1320 if (ia_vcc == NULL)
1321 { 1321 {
1322 atomic_inc(&vcc->stats->rx_err); 1322 atomic_inc(&vcc->stats->rx_err);
1323 atm_return(vcc, skb->truesize);
1323 dev_kfree_skb_any(skb); 1324 dev_kfree_skb_any(skb);
1324 atm_return(vcc, atm_guess_pdu2truesize(len));
1325 goto INCR_DLE; 1325 goto INCR_DLE;
1326 } 1326 }
1327 // get real pkt length pwang_test 1327 // get real pkt length pwang_test
@@ -1334,8 +1334,8 @@ static void rx_dle_intr(struct atm_dev *dev)
1334 atomic_inc(&vcc->stats->rx_err); 1334 atomic_inc(&vcc->stats->rx_err);
1335 IF_ERR(printk("rx_dle_intr: Bad AAL5 trailer %d (skb len %d)", 1335 IF_ERR(printk("rx_dle_intr: Bad AAL5 trailer %d (skb len %d)",
1336 length, skb->len);) 1336 length, skb->len);)
1337 atm_return(vcc, skb->truesize);
1337 dev_kfree_skb_any(skb); 1338 dev_kfree_skb_any(skb);
1338 atm_return(vcc, atm_guess_pdu2truesize(len));
1339 goto INCR_DLE; 1339 goto INCR_DLE;
1340 } 1340 }
1341 skb_trim(skb, length); 1341 skb_trim(skb, length);
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 43ea1b2de3ee..f4ff882cb2da 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -445,16 +445,6 @@ void vcc_insert_socket(struct sock *sk);
445 445
446void atm_dev_release_vccs(struct atm_dev *dev); 446void atm_dev_release_vccs(struct atm_dev *dev);
447 447
448/*
449 * This is approximately the algorithm used by alloc_skb.
450 *
451 */
452
453static inline int atm_guess_pdu2truesize(int size)
454{
455 return SKB_TRUESIZE(size);
456}
457
458 448
459static inline void atm_force_charge(struct atm_vcc *vcc,int truesize) 449static inline void atm_force_charge(struct atm_vcc *vcc,int truesize)
460{ 450{
diff --git a/net/atm/atm_misc.c b/net/atm/atm_misc.c
index f41f02656ff4..876fbe83e2e4 100644
--- a/net/atm/atm_misc.c
+++ b/net/atm/atm_misc.c
@@ -26,7 +26,7 @@ struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc, int pdu_size,
26 gfp_t gfp_flags) 26 gfp_t gfp_flags)
27{ 27{
28 struct sock *sk = sk_atm(vcc); 28 struct sock *sk = sk_atm(vcc);
29 int guess = atm_guess_pdu2truesize(pdu_size); 29 int guess = SKB_TRUESIZE(pdu_size);
30 30
31 atm_force_charge(vcc, guess); 31 atm_force_charge(vcc, guess);
32 if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) { 32 if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) {