Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / net / hamradio / baycom_ser_fdx.c
index 2dc64f0..232793d 100644 (file)
@@ -79,6 +79,7 @@
 #include <asm/io.h>
 #include <linux/hdlcdrv.h>
 #include <linux/baycom.h>
+#include <linux/jiffies.h>
 
 /* --------------------------------------------------------------------- */
 
@@ -159,7 +160,7 @@ static inline void baycom_int_freq(struct baycom_state *bc)
         * measure the interrupt frequency
         */
        bc->debug_vals.cur_intcnt++;
-       if ((cur_jiffies - bc->debug_vals.last_jiffies) >= HZ) {
+       if (time_after_eq(cur_jiffies, bc->debug_vals.last_jiffies + HZ)) {
                bc->debug_vals.last_jiffies = cur_jiffies;
                bc->debug_vals.last_intcnt = bc->debug_vals.cur_intcnt;
                bc->debug_vals.cur_intcnt = 0;
@@ -529,19 +530,15 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr,
 {
        struct baycom_state *bc;
        struct baycom_ioctl bi;
-       int cmd2;
 
-       if (!dev || !dev->priv ||
-           ((struct baycom_state *)dev->priv)->hdrv.magic != HDLCDRV_MAGIC) {
-               printk(KERN_ERR "bc_ioctl: invalid device struct\n");
+       if (!dev)
                return -EINVAL;
-       }
+
        bc = netdev_priv(dev);
+       BUG_ON(bc->hdrv.magic != HDLCDRV_MAGIC);
 
        if (cmd != SIOCDEVPRIVATE)
                return -ENOIOCTLCMD;
-       if (get_user(cmd2, (int *)ifr->ifr_data))
-               return -EFAULT;
        switch (hi->cmd) {
        default:
                break;
@@ -602,13 +599,13 @@ static int iobase[NR_PORTS] = { 0x3f8, };
 static int irq[NR_PORTS] = { 4, };
 static int baud[NR_PORTS] = { [0 ... NR_PORTS-1] = 1200 };
 
-MODULE_PARM(mode, "1-" __MODULE_STRING(NR_PORTS) "s");
+module_param_array(mode, charp, NULL, 0);
 MODULE_PARM_DESC(mode, "baycom operating mode; * for software DCD");
-MODULE_PARM(iobase, "1-" __MODULE_STRING(NR_PORTS) "i");
+module_param_array(iobase, int, NULL, 0);
 MODULE_PARM_DESC(iobase, "baycom io base address");
-MODULE_PARM(irq, "1-" __MODULE_STRING(NR_PORTS) "i");
+module_param_array(irq, int, NULL, 0);
 MODULE_PARM_DESC(irq, "baycom irq number");
-MODULE_PARM(baud, "1-" __MODULE_STRING(NR_PORTS) "i");
+module_param_array(baud, int, NULL, 0);
 MODULE_PARM_DESC(baud, "baycom baud rate (300 to 4800)");
 
 MODULE_AUTHOR("Thomas M. Sailer, sailer@ife.ee.ethz.ch, hb9jnx@hb9w.che.eu");