ALSA: usb-audio: add support for Akai MPD16
[safe/jmp/linux-2.6] / drivers / atm / zatm.c
index 020a87a..702acce 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/capability.h>
 #include <linux/bitops.h>
 #include <linux/wait.h>
+#include <linux/slab.h>
 #include <asm/byteorder.h>
 #include <asm/system.h>
 #include <asm/string.h>
@@ -496,8 +497,8 @@ static int open_rx_first(struct atm_vcc *vcc)
                        vcc->qos.rxtp.max_sdu = 65464;
                        /* fix this - we may want to receive 64kB SDUs
                           later */
-               cells = (vcc->qos.rxtp.max_sdu+ATM_AAL5_TRAILER+
-                   ATM_CELL_PAYLOAD-1)/ATM_CELL_PAYLOAD;
+               cells = DIV_ROUND_UP(vcc->qos.rxtp.max_sdu + ATM_AAL5_TRAILER,
+                               ATM_CELL_PAYLOAD);
                zatm_vcc->pool = pool_index(cells*ATM_CELL_PAYLOAD);
        }
        else {
@@ -820,7 +821,7 @@ static int alloc_shaper(struct atm_dev *dev,int *pcr,int min,int max,int ubr)
                        }
                        else {
                                i = 255;
-                               m = (ATM_OC3_PCR*255+max-1)/max;
+                               m = DIV_ROUND_UP(ATM_OC3_PCR*255, max);
                        }
                }
                if (i > m) {
@@ -915,7 +916,7 @@ static int open_tx_first(struct atm_vcc *vcc)
        unsigned long flags;
        u32 *loop;
        unsigned short chan;
-       int pcr,unlimited;
+       int unlimited;
 
        DPRINTK("open_tx_first\n");
        zatm_dev = ZATM_DEV(vcc->dev);
@@ -936,6 +937,8 @@ static int open_tx_first(struct atm_vcc *vcc)
            vcc->qos.txtp.max_pcr >= ATM_OC3_PCR);
        if (unlimited && zatm_dev->ubr != -1) zatm_vcc->shaper = zatm_dev->ubr;
        else {
+               int uninitialized_var(pcr);
+
                if (unlimited) vcc->qos.txtp.max_sdu = ATM_MAX_AAL5_PDU;
                if ((zatm_vcc->shaper = alloc_shaper(vcc->dev,&pcr,
                    vcc->qos.txtp.min_pcr,vcc->qos.txtp.max_pcr,unlimited))
@@ -1515,7 +1518,7 @@ static int zatm_getsockopt(struct atm_vcc *vcc,int level,int optname,
 
 
 static int zatm_setsockopt(struct atm_vcc *vcc,int level,int optname,
-    void __user *optval,int optlen)
+    void __user *optval,unsigned int optlen)
 {
        return -EINVAL;
 }