]> git.hungrycats.org Git - linux/commitdiff
[ATM]: Fix total_len calculation in IPHASE driver.
authorChas Williams <chas@locutus.cmf.nrl.navy.mil>
Tue, 25 Mar 2003 14:40:38 +0000 (06:40 -0800)
committerDavid S. Miller <davem@nuts.ninka.net>
Tue, 25 Mar 2003 14:40:38 +0000 (06:40 -0800)
drivers/atm/iphase.c

index bfd57e3f62d97bdbeadb466f1c0c383f6451a9c0..8a0fe8cbeee198e0d9dd5c5dc376283e54289b74 100644 (file)
@@ -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 */