Commit ad6d2e6d authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] jiffy type warning fixes

Fix various places which aren't using unsigned long for jiffies.

Also other warnings and compilation errors as encountered.
parent bcf1f7c6
...@@ -613,18 +613,21 @@ static void ps2esdi_fill_cmd_block(u_short * cmd_blk, u_short cmd, ...@@ -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) static int ps2esdi_out_cmd_blk(u_short * cmd_blk)
{ {
int i, j; int i;
unsigned long jif;
u_char status; u_char status;
/* enable interrupts */ /* enable interrupts */
outb(CTRL_ENABLE_INTR, ESDI_CONTROL); outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
/* do not write to the controller, if it is busy */ /* do not write to the controller, if it is busy */
for (i = jiffies + ESDI_STAT_TIMEOUT; time_after(i, jiffies) && (inb(ESDI_STATUS) & for (jif = jiffies + ESDI_STAT_TIMEOUT;
STATUS_BUSY);); time_after(jif, jiffies) &&
(inb(ESDI_STATUS) & STATUS_BUSY); )
;
#if 0 #if 0
printk("%s: i(1)=%d\n", DEVICE_NAME, i); printk("%s: i(1)=%ld\n", DEVICE_NAME, jif);
#endif #endif
/* if device is still busy - then just time out */ /* if device is still busy - then just time out */
...@@ -642,8 +645,8 @@ static int ps2esdi_out_cmd_blk(u_short * cmd_blk) ...@@ -642,8 +645,8 @@ static int ps2esdi_out_cmd_blk(u_short * cmd_blk)
/* one by one send each word out */ /* one by one send each word out */
for (i = (((*cmd_blk) >> 14) + 1) << 1; i; i--) { for (i = (((*cmd_blk) >> 14) + 1) << 1; i; i--) {
status = inb(ESDI_STATUS); status = inb(ESDI_STATUS);
for (j = jiffies + ESDI_STAT_TIMEOUT; for (jif = jiffies + ESDI_STAT_TIMEOUT;
time_after(j, jiffies) && (status & STATUS_BUSY) && time_after(jif, jiffies) && (status & STATUS_BUSY) &&
(status & STATUS_CMD_INF); status = inb(ESDI_STATUS)); (status & STATUS_CMD_INF); status = inb(ESDI_STATUS));
if ((status & (STATUS_BUSY | STATUS_CMD_INF)) == STATUS_BUSY) { if ((status & (STATUS_BUSY | STATUS_CMD_INF)) == STATUS_BUSY) {
#if 0 #if 0
......
...@@ -509,7 +509,7 @@ static int notify_cmd(char cmd, short ignore_ex) ...@@ -509,7 +509,7 @@ static int notify_cmd(char cmd, short ignore_ex)
static int wait_for_ready(time_t timeout) static int wait_for_ready(time_t timeout)
{ {
int stat; int stat;
time_t spin_t; unsigned long spin_t;
/* Wait for ready or exception, without driving the loadavg up too much. /* Wait for ready or exception, without driving the loadavg up too much.
* In most cases, the tape drive already has READY asserted, * In most cases, the tape drive already has READY asserted,
......
...@@ -163,7 +163,8 @@ static int adv717x_attach(struct i2c_adapter *adap, int addr, unsigned short fla ...@@ -163,7 +163,8 @@ static int adv717x_attach(struct i2c_adapter *adap, int addr, unsigned short fla
{ {
struct adv7175 *encoder; struct adv7175 *encoder;
struct i2c_client *client; 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"); printk(KERN_INFO "adv717x: video chip found.\n");
client=kmalloc(sizeof(*client), GFP_KERNEL); client=kmalloc(sizeof(*client), GFP_KERNEL);
......
...@@ -426,7 +426,7 @@ static int mxb_init_done(struct saa7146_dev* dev) ...@@ -426,7 +426,7 @@ static int mxb_init_done(struct saa7146_dev* dev)
if( 1 == (err = i2c_transfer(&mxb->i2c_adapter, &msg, 1))) { if( 1 == (err = i2c_transfer(&mxb->i2c_adapter, &msg, 1))) {
for(i = 1;;i++) { for(i = 1;;i++) {
msg.len = saa7740_init[i].length; msg.len = saa7740_init[i].length;
if( -1 == msg.len ) { if (msg.len == -1U) {
break; break;
} }
msg.buf = &saa7740_init[i].data[0]; msg.buf = &saa7740_init[i].data[0];
......
...@@ -127,7 +127,7 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb, ...@@ -127,7 +127,7 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,
} }
static int 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; *size = TS_PACKET_SIZE * TS_NR_PACKETS;
if (0 == *count) if (0 == *count)
......
...@@ -882,7 +882,7 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb, ...@@ -882,7 +882,7 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,
} }
static int 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; struct saa7134_fh *fh = file->private_data;
......
...@@ -157,7 +157,9 @@ static inline void w9966_pdev_release(struct w9966_dev *vdev); ...@@ -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_rReg(struct w9966_dev* cam, int reg);
static int w9966_wReg(struct w9966_dev* cam, int reg, int data); 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); 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_wReg_i2c(struct w9966_dev* cam, int reg, int data);
static int w9966_findlen(int near, int size, int maxlen); 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); 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); ...@@ -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_getsda(struct w9966_dev* cam);
static inline int w9966_i2c_getscl(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); static int w9966_i2c_wbyte(struct w9966_dev* cam, int data);
#if 0
static int w9966_i2c_rbyte(struct w9966_dev* cam); static int w9966_i2c_rbyte(struct w9966_dev* cam);
#endif
static int w9966_v4l_ioctl(struct inode *inode, struct file *file, static int w9966_v4l_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
...@@ -555,7 +559,8 @@ static inline void w9966_i2c_setsda(struct w9966_dev* cam, int state) ...@@ -555,7 +559,8 @@ static inline void w9966_i2c_setsda(struct w9966_dev* cam, int state)
// Expects a claimed pdev. -1 on error // Expects a claimed pdev. -1 on error
static inline int w9966_i2c_setscl(struct w9966_dev* cam, int state) static inline int w9966_i2c_setscl(struct w9966_dev* cam, int state)
{ {
int timeout; unsigned long timeout;
if (state) if (state)
cam->i2c_state |= W9966_I2C_W_CLOCK; cam->i2c_state |= W9966_I2C_W_CLOCK;
else else
...@@ -616,6 +621,7 @@ static int w9966_i2c_wbyte(struct w9966_dev* cam, int data) ...@@ -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 // Read a data byte with ack from the i2c-bus
// Expects a claimed pdev. -1 on error // Expects a claimed pdev. -1 on error
#if 0
static int w9966_i2c_rbyte(struct w9966_dev* cam) static int w9966_i2c_rbyte(struct w9966_dev* cam)
{ {
unsigned char data = 0x00; unsigned char data = 0x00;
...@@ -635,9 +641,11 @@ static int w9966_i2c_rbyte(struct w9966_dev* cam) ...@@ -635,9 +641,11 @@ static int w9966_i2c_rbyte(struct w9966_dev* cam)
} }
return data; return data;
} }
#endif
// Read a register from the i2c device. // Read a register from the i2c device.
// Expects claimed pdev. -1 on error // Expects claimed pdev. -1 on error
#if 0
static int w9966_rReg_i2c(struct w9966_dev* cam, int reg) static int w9966_rReg_i2c(struct w9966_dev* cam, int reg)
{ {
int data; int data;
...@@ -671,6 +679,7 @@ static int w9966_rReg_i2c(struct w9966_dev* cam, int reg) ...@@ -671,6 +679,7 @@ static int w9966_rReg_i2c(struct w9966_dev* cam, int reg)
return data; return data;
} }
#endif
// Write a register to the i2c device. // Write a register to the i2c device.
// Expects claimed pdev. -1 on error // Expects claimed pdev. -1 on error
......
...@@ -431,7 +431,7 @@ static int sharp_do_wait_for_ready(struct map_info *map, struct flchip *chip, ...@@ -431,7 +431,7 @@ static int sharp_do_wait_for_ready(struct map_info *map, struct flchip *chip,
unsigned long adr) unsigned long adr)
{ {
int ret; int ret;
int timeo; unsigned long timeo;
int status; int status;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
......
...@@ -1295,7 +1295,7 @@ int __init init_module(void) ...@@ -1295,7 +1295,7 @@ int __init init_module(void)
static void __exit ltpc_cleanup(void) static void __exit ltpc_cleanup(void)
{ {
long timeout; unsigned long timeout;
ltpc_timer.data = 0; /* signal the poll routine that we're done */ ltpc_timer.data = 0; /* signal the poll routine that we're done */
......
...@@ -246,7 +246,8 @@ static void __devinit find_turbo_adapters(int *iolist) { ...@@ -246,7 +246,8 @@ static void __devinit find_turbo_adapters(int *iolist) {
void *chanid; void *chanid;
int found_turbo=0; int found_turbo=0;
unsigned char *tchanid, ctemp; unsigned char *tchanid, ctemp;
int i,j; int i, j;
unsigned long jif;
void *ram_mapped ; void *ram_mapped ;
if (turbo_searched == 1) return; if (turbo_searched == 1) return;
...@@ -276,7 +277,7 @@ static void __devinit find_turbo_adapters(int *iolist) { ...@@ -276,7 +277,7 @@ static void __devinit find_turbo_adapters(int *iolist) {
writeb(0x00, ram_mapped+0x1E01+i); writeb(0x00, ram_mapped+0x1E01+i);
} }
writeb(0x00, ram_mapped+0x1E01); 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)); intf_tbl=ntohs(readw(ram_mapped+ACA_OFFSET+ACA_RW+WRBR_EVEN));
if (intf_tbl) { if (intf_tbl) {
#if IBMTR_DEBUG_MESSAGES #if IBMTR_DEBUG_MESSAGES
...@@ -291,7 +292,7 @@ static void __devinit find_turbo_adapters(int *iolist) { ...@@ -291,7 +292,7 @@ static void __devinit find_turbo_adapters(int *iolist) {
turbo_io[index]=ntohs(readw(ram_mapped+intf_tbl+4)); turbo_io[index]=ntohs(readw(ram_mapped+intf_tbl+4));
turbo_irq[index]=readb(ram_mapped+intf_tbl+3); turbo_irq[index]=readb(ram_mapped+intf_tbl+3);
outb(0, turbo_io[index] + ADAPTRESET); 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); outb(0, turbo_io[index] + ADAPTRESETREL);
index++; index++;
continue; continue;
......
...@@ -1048,8 +1048,10 @@ static int sprintf_neighbours(char *buffer, MetricomNodeTable * table, ...@@ -1048,8 +1048,10 @@ static int sprintf_neighbours(char *buffer, MetricomNodeTable * table,
if (table->num_nodes) if (table->num_nodes)
ptr += sprintf(ptr, "\n %s\n", title); ptr += sprintf(ptr, "\n %s\n", title);
for (i = 0; i < table->num_nodes; i++) { for (i = 0; i < table->num_nodes; i++) {
MetricomNode node;
spin_lock_irqsave(&strip_lock, flags); spin_lock_irqsave(&strip_lock, flags);
MetricomNode node = table->node[i]; node = table->node[i];
spin_unlock_irqrestore(&strip_lock, flags); spin_unlock_irqrestore(&strip_lock, flags);
ptr += sprintf(ptr, " %s\n", node.c); ptr += sprintf(ptr, " %s\n", node.c);
} }
......
...@@ -288,7 +288,9 @@ static int ql_pdma(int phase, char *request, int reqlen) ...@@ -288,7 +288,9 @@ static int ql_pdma(int phase, char *request, int reqlen)
static int ql_wai(void) static int ql_wai(void)
{ {
int i, k; int k;
unsigned long i;
k = 0; k = 0;
i = jiffies + WATCHDOG; i = jiffies + WATCHDOG;
while (time_before(jiffies, i) && !qabort && !((k = inb(qbase + 4)) & 0xe0)) { while (time_before(jiffies, i) && !qabort && !((k = inb(qbase + 4)) & 0xe0)) {
...@@ -359,7 +361,8 @@ static void ql_icmd(Scsi_Cmnd * cmd) ...@@ -359,7 +361,8 @@ static void ql_icmd(Scsi_Cmnd * cmd)
static unsigned int ql_pcmd(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 result; /* ultimate return result */
unsigned int status; /* scsi returned status */ unsigned int status; /* scsi returned status */
unsigned int message; /* scsi returned message */ unsigned int message; /* scsi returned message */
......
...@@ -248,7 +248,7 @@ static __inline__ unsigned int sym53c416_read(int base, unsigned char *buffer, u ...@@ -248,7 +248,7 @@ static __inline__ unsigned int sym53c416_read(int base, unsigned char *buffer, u
unsigned int orig_len = len; unsigned int orig_len = len;
unsigned long flags = 0; unsigned long flags = 0;
unsigned int bytes_left; unsigned int bytes_left;
int i; unsigned long i;
int timeout = READ_TIMEOUT; int timeout = READ_TIMEOUT;
/* Do transfer */ /* Do transfer */
...@@ -290,7 +290,7 @@ static __inline__ unsigned int sym53c416_write(int base, unsigned char *buffer, ...@@ -290,7 +290,7 @@ static __inline__ unsigned int sym53c416_write(int base, unsigned char *buffer,
unsigned int orig_len = len; unsigned int orig_len = len;
unsigned long flags = 0; unsigned long flags = 0;
unsigned int bufferfree; unsigned int bufferfree;
unsigned int i; unsigned long i;
unsigned int timeout = WRITE_TIMEOUT; unsigned int timeout = WRITE_TIMEOUT;
/* Do transfer */ /* Do transfer */
...@@ -540,7 +540,8 @@ static void sym53c416_init(int base, int scsi_id) ...@@ -540,7 +540,8 @@ static void sym53c416_init(int base, int scsi_id)
static int sym53c416_probeirq(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 */ /* Clear interrupt register */
inb(base + INT_REG); inb(base + INT_REG);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment