From 07c90427ec3a255edfc4fa4b1ed3e8672995431a Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Tue, 25 Mar 2003 06:40:38 -0800 Subject: [PATCH] [ATM]: Fix total_len calculation in IPHASE driver. --- drivers/atm/iphase.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index bfd57e3f62d97..8a0fe8cbeee19 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -2893,7 +2893,7 @@ static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) { struct tx_buf_desc *buf_desc_ptr; int desc; int comp_code; - int total_len, pad, last; + int total_len; struct cpcs_trailer *trailer; struct ia_vcc *iavcc; @@ -2975,9 +2975,7 @@ static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) { /* Figure out the exact length of the packet and padding required to make it aligned on a 48 byte boundary. */ total_len = skb->len + sizeof(struct cpcs_trailer); - last = total_len - (total_len/48)*48; - pad = 48 - last; - total_len = pad + total_len; + total_len = ((total_len + 47) / 48) * 48; IF_TX(printk("ia packet len:%d padding:%d\n", total_len, pad);) /* Put the packet in a tx buffer */ -- 2.53.0