]> git.hungrycats.org Git - linux/commitdiff
[PATCH] jiffy type warning fixes
authorAndrew Morton <akpm@digeo.com>
Thu, 24 Apr 2003 15:59:36 +0000 (08:59 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 24 Apr 2003 15:59:36 +0000 (08:59 -0700)
Fix various places which aren't using unsigned long for jiffies.

Also other warnings and compilation errors as encountered.

13 files changed:
drivers/block/ps2esdi.c
drivers/char/tpqic02.c
drivers/media/video/adv7175.c
drivers/media/video/mxb.c
drivers/media/video/saa7134/saa7134-ts.c
drivers/media/video/saa7134/saa7134-video.c
drivers/media/video/w9966.c
drivers/mtd/chips/sharp.c
drivers/net/appletalk/ltpc.c
drivers/net/tokenring/ibmtr.c
drivers/net/wireless/strip.c
drivers/scsi/qlogicfas.c
drivers/scsi/sym53c416.c

index 9fd139ad3bfbf01ca1db4444c25dda35e803c306..03454cf731c64ce2e24c58b6929ee6b2dac98be0 100644 (file)
@@ -613,18 +613,21 @@ static void ps2esdi_fill_cmd_block(u_short * cmd_blk, u_short cmd,
 static int ps2esdi_out_cmd_blk(u_short * cmd_blk)
 {
 
-       int i, j;
+       int i;
+       unsigned long jif;
        u_char status;
 
        /* enable interrupts */
        outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
 
        /* do not write to the controller, if it is busy */
-       for (i = jiffies + ESDI_STAT_TIMEOUT; time_after(i, jiffies) && (inb(ESDI_STATUS) &
-                                                         STATUS_BUSY););
+       for (jif = jiffies + ESDI_STAT_TIMEOUT;
+               time_after(jif, jiffies) &&
+                       (inb(ESDI_STATUS) & STATUS_BUSY); )
+               ;
 
 #if 0
-       printk("%s: i(1)=%d\n", DEVICE_NAME, i);
+       printk("%s: i(1)=%ld\n", DEVICE_NAME, jif);
 #endif
 
        /* if device is still busy - then just time out */
@@ -642,8 +645,8 @@ static int ps2esdi_out_cmd_blk(u_short * cmd_blk)
        /* one by one send each word out */
        for (i = (((*cmd_blk) >> 14) + 1) << 1; i; i--) {
                status = inb(ESDI_STATUS);
-               for (j = jiffies + ESDI_STAT_TIMEOUT;
-                    time_after(j, jiffies) && (status & STATUS_BUSY) &&
+               for (jif = jiffies + ESDI_STAT_TIMEOUT;
+                    time_after(jif, jiffies) && (status & STATUS_BUSY) &&
                   (status & STATUS_CMD_INF); status = inb(ESDI_STATUS));
                if ((status & (STATUS_BUSY | STATUS_CMD_INF)) == STATUS_BUSY) {
 #if 0
index a2e9230cc1fc60c030b69904ed6da3476c382afd..fead16bc852c8cce9294be5943c422a6356b9431 100644 (file)
@@ -509,7 +509,7 @@ static int notify_cmd(char cmd, short ignore_ex)
 static int wait_for_ready(time_t timeout)
 {
        int stat;
-       time_t spin_t;
+       unsigned long spin_t;
 
        /* Wait for ready or exception, without driving the loadavg up too much.
         * In most cases, the tape drive already has READY asserted,
index 049fcc12a6cca274a695860c4a54cc146813d389..0b9aa08f1090c1fb5cce72df17fcf92b6793b30d 100644 (file)
@@ -163,7 +163,8 @@ static int adv717x_attach(struct i2c_adapter *adap, int addr, unsigned short fla
 {
        struct adv7175 *encoder;
        struct  i2c_client      *client;
-       int rv, i, x_common=39; /* x is number entries init_common - 1 */
+       int rv = 0;
+       int i, x_common=39; /* x is number entries init_common - 1 */
 
        printk(KERN_INFO "adv717x: video chip found.\n");
        client=kmalloc(sizeof(*client), GFP_KERNEL);
index c5a5e6921c13feec775e3b40dbc427d283c11490..ac088a3b02a43aef2d0b197570ad5d793c6fbf63 100644 (file)
@@ -426,7 +426,7 @@ static int mxb_init_done(struct saa7146_dev* dev)
        if( 1 == (err = i2c_transfer(&mxb->i2c_adapter, &msg, 1))) {
                for(i = 1;;i++) {
                        msg.len = saa7740_init[i].length;               
-                       if( -1 == msg.len ) {
+                       if (msg.len == -1U) {
                                break;
                        }
                        msg.buf = &saa7740_init[i].data[0];
index c84751f84f24c9671c1ce0a2361002ab9b194d9f..49ea9eb1e101c72f2984d31d0506ba11670e1a8c 100644 (file)
@@ -127,7 +127,7 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,
 }
 
 static int
-buffer_setup(struct file *file, int *count, int *size)
+buffer_setup(struct file *file, unsigned int *count, unsigned int *size)
 {
        *size = TS_PACKET_SIZE * TS_NR_PACKETS;
        if (0 == *count)
index 7562ae4e3490b7e1a24b4895626961f4d41c86b2..ede39b9f90b82d81de07e13bf778ae0fb0d22af4 100644 (file)
@@ -882,7 +882,7 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,
 }
 
 static int
-buffer_setup(struct file *file, int *count, int *size)
+buffer_setup(struct file *file, unsigned int *count, unsigned int *size)
 {
        struct saa7134_fh *fh = file->private_data;
 
index 11b92d36bba7dbd346a7934e92db2f06fcf026e7..64967db6c8cceec42df49689a1710a11e1441759 100644 (file)
@@ -157,7 +157,9 @@ static inline void w9966_pdev_release(struct w9966_dev *vdev);
 
 static int w9966_rReg(struct w9966_dev* cam, int reg);
 static int w9966_wReg(struct w9966_dev* cam, int reg, int data);
+#if 0
 static int w9966_rReg_i2c(struct w9966_dev* cam, int reg);
+#endif
 static int w9966_wReg_i2c(struct w9966_dev* cam, int reg, int data);
 static int w9966_findlen(int near, int size, int maxlen);
 static int w9966_calcscale(int size, int min, int max, int* beg, int* end, unsigned char* factor);
@@ -171,7 +173,9 @@ static inline int  w9966_i2c_setscl(struct w9966_dev* cam, int state);
 static inline int  w9966_i2c_getsda(struct w9966_dev* cam);
 static inline int  w9966_i2c_getscl(struct w9966_dev* cam);
 static int w9966_i2c_wbyte(struct w9966_dev* cam, int data);
+#if 0
 static int w9966_i2c_rbyte(struct w9966_dev* cam);
+#endif
 
 static int w9966_v4l_ioctl(struct inode *inode, struct file *file,
                           unsigned int cmd, unsigned long arg);
@@ -555,7 +559,8 @@ static inline void w9966_i2c_setsda(struct w9966_dev* cam, int state)
 // Expects a claimed pdev. -1 on error
 static inline int w9966_i2c_setscl(struct w9966_dev* cam, int state)
 {
-       int timeout;
+       unsigned long timeout;
+
        if (state)
                cam->i2c_state |= W9966_I2C_W_CLOCK;
        else
@@ -616,6 +621,7 @@ static int w9966_i2c_wbyte(struct w9966_dev* cam, int data)
 
 // Read a data byte with ack from the i2c-bus
 // Expects a claimed pdev. -1 on error
+#if 0
 static int w9966_i2c_rbyte(struct w9966_dev* cam)
 {
        unsigned char data = 0x00;
@@ -635,9 +641,11 @@ static int w9966_i2c_rbyte(struct w9966_dev* cam)
        }
        return data;
 }
+#endif
 
 // Read a register from the i2c device.
 // Expects claimed pdev. -1 on error
+#if 0
 static int w9966_rReg_i2c(struct w9966_dev* cam, int reg)
 {
        int data;
@@ -671,6 +679,7 @@ static int w9966_rReg_i2c(struct w9966_dev* cam, int reg)
        
        return data;
 }
+#endif
 
 // Write a register to the i2c device.
 // Expects claimed pdev. -1 on error
index df650c1dbc88c90f6479e3b5303d314a2271f2d7..21d24318afee14a9d6527a89fad8284d7fc90374 100644 (file)
@@ -431,7 +431,7 @@ static int sharp_do_wait_for_ready(struct map_info *map, struct flchip *chip,
        unsigned long adr)
 {
        int ret;
-       int timeo;
+       unsigned long timeo;
        int status;
        DECLARE_WAITQUEUE(wait, current);
 
index 09427f6d50dcd7118493728e63feb37c965473ba..3472cfd8fbc93620cfecb6a5a05d00449fc001da 100644 (file)
@@ -1295,7 +1295,7 @@ int __init init_module(void)
 
 static void __exit ltpc_cleanup(void)
 {
-       long timeout;
+       unsigned long timeout;
 
        ltpc_timer.data = 0;  /* signal the poll routine that we're done */
 
index 74906d093d3fee13392c487f84883c5caf4a05bc..da983c0aeea122b935e4cecbd4db749d1065cff6 100644 (file)
@@ -246,7 +246,8 @@ static void __devinit find_turbo_adapters(int *iolist) {
        void *chanid;
        int found_turbo=0;
        unsigned char *tchanid, ctemp;
-       int i,j;
+       int i, j;
+       unsigned long jif;
        void *ram_mapped ;   
 
        if (turbo_searched == 1) return;
@@ -276,7 +277,7 @@ static void __devinit find_turbo_adapters(int *iolist) {
                        writeb(0x00, ram_mapped+0x1E01+i);
                }
                writeb(0x00, ram_mapped+0x1E01);
-               for(i=jiffies+TR_BUSY_INTERVAL; time_before_eq(jiffies,i););
+               for(jif=jiffies+TR_BUSY_INTERVAL; time_before_eq(jiffies,jif););
                intf_tbl=ntohs(readw(ram_mapped+ACA_OFFSET+ACA_RW+WRBR_EVEN));
                if (intf_tbl) {
 #if IBMTR_DEBUG_MESSAGES
@@ -291,7 +292,7 @@ static void __devinit find_turbo_adapters(int *iolist) {
                        turbo_io[index]=ntohs(readw(ram_mapped+intf_tbl+4));
                        turbo_irq[index]=readb(ram_mapped+intf_tbl+3);
                        outb(0, turbo_io[index] + ADAPTRESET);
-                       for(i=jiffies+TR_RST_TIME;time_before_eq(jiffies,i););
+                       for(jif=jiffies+TR_RST_TIME;time_before_eq(jiffies,jif););
                        outb(0, turbo_io[index] + ADAPTRESETREL);
                        index++;
                        continue;
index aee42c4994d37db8ec56237b696dca7fe267db9b..47faf8cc795e3acb47d2a1b6b229a0510d4f5a33 100644 (file)
@@ -1048,8 +1048,10 @@ static int sprintf_neighbours(char *buffer, MetricomNodeTable * table,
                if (table->num_nodes)
                        ptr += sprintf(ptr, "\n %s\n", title);
                for (i = 0; i < table->num_nodes; i++) {
+                       MetricomNode node;
+
                        spin_lock_irqsave(&strip_lock, flags);
-                       MetricomNode node = table->node[i];
+                       node = table->node[i];
                        spin_unlock_irqrestore(&strip_lock, flags);
                        ptr += sprintf(ptr, "  %s\n", node.c);
                }
index eb1c8e0d59a8cad2f732a415967fdecbce4b5f69..e29d6429be8acb081d66f18c78a85dd9121ca888 100644 (file)
@@ -288,7 +288,9 @@ static int ql_pdma(int phase, char *request, int reqlen)
 
 static int ql_wai(void)
 {
-       int i, k;
+       int k;
+       unsigned long i;
+
        k = 0;
        i = jiffies + WATCHDOG;
        while (time_before(jiffies, i) && !qabort && !((k = inb(qbase + 4)) & 0xe0)) {
@@ -359,7 +361,8 @@ static void ql_icmd(Scsi_Cmnd * cmd)
 
 static unsigned int ql_pcmd(Scsi_Cmnd * cmd)
 {
-       unsigned int i, j, k;
+       unsigned int i, j;
+       unsigned long k;
        unsigned int result;    /* ultimate return result */
        unsigned int status;    /* scsi returned status */
        unsigned int message;   /* scsi returned message */
index c486623c15183a2886a0a268cb0ec6e1e0152198..3eee0654ff096582ec84a38695f07afd374bc7f6 100644 (file)
@@ -248,7 +248,7 @@ static __inline__ unsigned int sym53c416_read(int base, unsigned char *buffer, u
        unsigned int orig_len = len;
        unsigned long flags = 0;
        unsigned int bytes_left;
-       int i;
+       unsigned long i;
        int timeout = READ_TIMEOUT;
 
        /* Do transfer */
@@ -290,7 +290,7 @@ static __inline__ unsigned int sym53c416_write(int base, unsigned char *buffer,
        unsigned int orig_len = len;
        unsigned long flags = 0;
        unsigned int bufferfree;
-       unsigned int i;
+       unsigned long i;
        unsigned int timeout = WRITE_TIMEOUT;
 
        /* Do transfer */
@@ -540,7 +540,8 @@ static void sym53c416_init(int base, int scsi_id)
 
 static int sym53c416_probeirq(int base, int scsi_id)
 {
-       int irq, irqs, i;
+       int irq, irqs;
+       unsigned long i;
 
        /* Clear interrupt register */
        inb(base + INT_REG);