Skip to content

Commit

Permalink
atm: eliminate atm_guess_pdu2truesize()
Browse files Browse the repository at this point in the history
Signed-off-by: Chas Williams - CONTRACTOR <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
chas williams - CONTRACTOR authored and davem330 committed Nov 26, 2011
1 parent 021ac8d commit 49f5ed4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
4 changes: 2 additions & 2 deletions drivers/atm/iphase.c
Original file line number Diff line number Diff line change
Expand Up @@ -1320,8 +1320,8 @@ static void rx_dle_intr(struct atm_dev *dev)
if (ia_vcc == NULL)
{
atomic_inc(&vcc->stats->rx_err);
atm_return(vcc, skb->truesize);
dev_kfree_skb_any(skb);
atm_return(vcc, atm_guess_pdu2truesize(len));
goto INCR_DLE;
}
// get real pkt length pwang_test
Expand All @@ -1334,8 +1334,8 @@ static void rx_dle_intr(struct atm_dev *dev)
atomic_inc(&vcc->stats->rx_err);
IF_ERR(printk("rx_dle_intr: Bad AAL5 trailer %d (skb len %d)",
length, skb->len);)
atm_return(vcc, skb->truesize);
dev_kfree_skb_any(skb);
atm_return(vcc, atm_guess_pdu2truesize(len));
goto INCR_DLE;
}
skb_trim(skb, length);
Expand Down
10 changes: 0 additions & 10 deletions include/linux/atmdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,16 +445,6 @@ void vcc_insert_socket(struct sock *sk);

void atm_dev_release_vccs(struct atm_dev *dev);

/*
* This is approximately the algorithm used by alloc_skb.
*
*/

static inline int atm_guess_pdu2truesize(int size)
{
return SKB_TRUESIZE(size);
}


static inline void atm_force_charge(struct atm_vcc *vcc,int truesize)
{
Expand Down
2 changes: 1 addition & 1 deletion net/atm/atm_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc, int pdu_size,
gfp_t gfp_flags)
{
struct sock *sk = sk_atm(vcc);
int guess = atm_guess_pdu2truesize(pdu_size);
int guess = SKB_TRUESIZE(pdu_size);

atm_force_charge(vcc, guess);
if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) {
Expand Down

0 comments on commit 49f5ed4

Please sign in to comment.