Commit e8be02a3 authored by Richard Knutsson's avatar Richard Knutsson Committed by Mauro Carvalho Chehab

V4L/DVB (5197): Convert to generic boolean-values

Signed-off-by: default avatarRichard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 7a9ca4a3
...@@ -111,7 +111,7 @@ static int saa5246a_attach(struct i2c_adapter *adap, int addr, int kind) ...@@ -111,7 +111,7 @@ static int saa5246a_attach(struct i2c_adapter *adap, int addr, int kind)
for (pgbuf = 0; pgbuf < NUM_DAUS; pgbuf++) for (pgbuf = 0; pgbuf < NUM_DAUS; pgbuf++)
{ {
memset(t->pgbuf[pgbuf], ' ', sizeof(t->pgbuf[0])); memset(t->pgbuf[pgbuf], ' ', sizeof(t->pgbuf[0]));
t->is_searching[pgbuf] = FALSE; t->is_searching[pgbuf] = false;
} }
vd->priv=t; vd->priv=t;
...@@ -198,7 +198,7 @@ static int i2c_senddata(struct saa5246a_device *t, ...) ...@@ -198,7 +198,7 @@ static int i2c_senddata(struct saa5246a_device *t, ...)
/* Get count number of bytes from IC-device at address adr, store them in buf. /* Get count number of bytes from IC-device at address adr, store them in buf.
* Start & stop handshaking is done by this routine, ack will be sent after the * Start & stop handshaking is done by this routine, ack will be sent after the
* last byte to inhibit further sending of data. If uaccess is TRUE, data is * last byte to inhibit further sending of data. If uaccess is 'true', data is
* written to user-space with put_user. Returns -1 if IC-device didn't send * written to user-space with put_user. Returns -1 if IC-device didn't send
* acknowledge, 0 otherwise * acknowledge, 0 otherwise
*/ */
...@@ -338,7 +338,7 @@ static int saa5246a_request_page(struct saa5246a_device *t, ...@@ -338,7 +338,7 @@ static int saa5246a_request_page(struct saa5246a_device *t,
return -EIO; return -EIO;
} }
t->is_searching[req->pgbuf] = TRUE; t->is_searching[req->pgbuf] = true;
return 0; return 0;
} }
...@@ -452,7 +452,7 @@ static inline int saa5246a_get_status(struct saa5246a_device *t, ...@@ -452,7 +452,7 @@ static inline int saa5246a_get_status(struct saa5246a_device *t,
} }
} }
if (!info->hamming && !info->notfound) if (!info->hamming && !info->notfound)
t->is_searching[dau_no] = FALSE; t->is_searching[dau_no] = false;
return 0; return 0;
} }
...@@ -564,7 +564,7 @@ static inline int saa5246a_stop_dau(struct saa5246a_device *t, ...@@ -564,7 +564,7 @@ static inline int saa5246a_stop_dau(struct saa5246a_device *t,
{ {
return -EIO; return -EIO;
} }
t->is_searching[dau_no] = FALSE; t->is_searching[dau_no] = false;
return 0; return 0;
} }
......
...@@ -41,23 +41,18 @@ ...@@ -41,23 +41,18 @@
#define POS_HEADER_START 7 #define POS_HEADER_START 7
#define POS_HEADER_END 31 #define POS_HEADER_END 31
/* Returns TRUE if the part of the videotext page described with req contains /* Returns 'true' if the part of the videotext page described with req contains
(at least parts of) the time field */ (at least parts of) the time field */
#define REQ_CONTAINS_TIME(p_req) \ #define REQ_CONTAINS_TIME(p_req) \
((p_req)->start <= POS_TIME_END && \ ((p_req)->start <= POS_TIME_END && \
(p_req)->end >= POS_TIME_START) (p_req)->end >= POS_TIME_START)
/* Returns TRUE if the part of the videotext page described with req contains /* Returns 'true' if the part of the videotext page described with req contains
(at least parts of) the page header */ (at least parts of) the page header */
#define REQ_CONTAINS_HEADER(p_req) \ #define REQ_CONTAINS_HEADER(p_req) \
((p_req)->start <= POS_HEADER_END && \ ((p_req)->start <= POS_HEADER_END && \
(p_req)->end >= POS_HEADER_START) (p_req)->end >= POS_HEADER_START)
#ifndef FALSE
#define FALSE 0
#define TRUE 1
#endif
/*****************************************************************************/ /*****************************************************************************/
/* Mode register numbers of the SAA5246A */ /* Mode register numbers of the SAA5246A */
/*****************************************************************************/ /*****************************************************************************/
......
...@@ -124,11 +124,6 @@ struct saa5249_device ...@@ -124,11 +124,6 @@ struct saa5249_device
/* General defines and debugging support */ /* General defines and debugging support */
#ifndef FALSE
#define FALSE 0
#define TRUE 1
#endif
#define RESCHED do { cond_resched(); } while(0) #define RESCHED do { cond_resched(); } while(0)
static struct video_device saa_template; /* Declared near bottom */ static struct video_device saa_template; /* Declared near bottom */
...@@ -183,9 +178,9 @@ static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind) ...@@ -183,9 +178,9 @@ static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind)
memset(t->vdau[pgbuf].sregs, 0, sizeof(t->vdau[0].sregs)); memset(t->vdau[pgbuf].sregs, 0, sizeof(t->vdau[0].sregs));
memset(t->vdau[pgbuf].laststat, 0, sizeof(t->vdau[0].laststat)); memset(t->vdau[pgbuf].laststat, 0, sizeof(t->vdau[0].laststat));
t->vdau[pgbuf].expire = 0; t->vdau[pgbuf].expire = 0;
t->vdau[pgbuf].clrfound = TRUE; t->vdau[pgbuf].clrfound = true;
t->vdau[pgbuf].stopped = TRUE; t->vdau[pgbuf].stopped = true;
t->is_searching[pgbuf] = FALSE; t->is_searching[pgbuf] = false;
} }
vd->priv=t; vd->priv=t;
...@@ -298,7 +293,7 @@ static int i2c_senddata(struct saa5249_device *t, ...) ...@@ -298,7 +293,7 @@ static int i2c_senddata(struct saa5249_device *t, ...)
/* Get count number of bytes from IC-device at address adr, store them in buf. Start & stop /* Get count number of bytes from IC-device at address adr, store them in buf. Start & stop
* handshaking is done by this routine, ack will be sent after the last byte to inhibit further * handshaking is done by this routine, ack will be sent after the last byte to inhibit further
* sending of data. If uaccess is TRUE, data is written to user-space with put_user. * sending of data. If uaccess is 'true', data is written to user-space with put_user.
* Returns -1 if IC-device didn't send acknowledge, 0 otherwise * Returns -1 if IC-device didn't send acknowledge, 0 otherwise
*/ */
...@@ -317,7 +312,7 @@ static int i2c_getdata(struct saa5249_device *t, int count, u8 *buf) ...@@ -317,7 +312,7 @@ static int i2c_getdata(struct saa5249_device *t, int count, u8 *buf)
static int do_saa5249_ioctl(struct inode *inode, struct file *file, static int do_saa5249_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *arg) unsigned int cmd, void *arg)
{ {
static int virtual_mode = FALSE; static int virtual_mode = false;
struct video_device *vd = video_devdata(file); struct video_device *vd = video_devdata(file);
struct saa5249_device *t=vd->priv; struct saa5249_device *t=vd->priv;
...@@ -340,7 +335,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file, ...@@ -340,7 +335,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file,
if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS) if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS)
return -EINVAL; return -EINVAL;
memset(t->vdau[req->pgbuf].pgbuf, ' ', sizeof(t->vdau[0].pgbuf)); memset(t->vdau[req->pgbuf].pgbuf, ' ', sizeof(t->vdau[0].pgbuf));
t->vdau[req->pgbuf].clrfound = TRUE; t->vdau[req->pgbuf].clrfound = true;
return 0; return 0;
} }
...@@ -350,7 +345,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file, ...@@ -350,7 +345,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file,
if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS) if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS)
return -EINVAL; return -EINVAL;
t->vdau[req->pgbuf].clrfound = TRUE; t->vdau[req->pgbuf].clrfound = true;
return 0; return 0;
} }
...@@ -376,9 +371,9 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file, ...@@ -376,9 +371,9 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file,
t->vdau[req->pgbuf].sregs[4] = (req->pagemask & HR_UNIT ? 0x10 : 0) | (req->hour & 0xf); t->vdau[req->pgbuf].sregs[4] = (req->pagemask & HR_UNIT ? 0x10 : 0) | (req->hour & 0xf);
t->vdau[req->pgbuf].sregs[5] = (req->pagemask & MIN_TEN ? 0x10 : 0) | (req->minute / 0x10); t->vdau[req->pgbuf].sregs[5] = (req->pagemask & MIN_TEN ? 0x10 : 0) | (req->minute / 0x10);
t->vdau[req->pgbuf].sregs[6] = (req->pagemask & MIN_UNIT ? 0x10 : 0) | (req->minute & 0xf); t->vdau[req->pgbuf].sregs[6] = (req->pagemask & MIN_UNIT ? 0x10 : 0) | (req->minute & 0xf);
t->vdau[req->pgbuf].stopped = FALSE; t->vdau[req->pgbuf].stopped = false;
t->vdau[req->pgbuf].clrfound = TRUE; t->vdau[req->pgbuf].clrfound = true;
t->is_searching[req->pgbuf] = TRUE; t->is_searching[req->pgbuf] = true;
return 0; return 0;
} }
...@@ -430,7 +425,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file, ...@@ -430,7 +425,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file,
i2c_getdata(t, 40, t->vdau[req->pgbuf].pgbuf + VTX_PAGESIZE + 23 * 40)) i2c_getdata(t, 40, t->vdau[req->pgbuf].pgbuf + VTX_PAGESIZE + 23 * 40))
return -EIO; return -EIO;
} }
t->vdau[req->pgbuf].clrfound = FALSE; t->vdau[req->pgbuf].clrfound = false;
memcpy(t->vdau[req->pgbuf].laststat, infobits, sizeof(infobits)); memcpy(t->vdau[req->pgbuf].laststat, infobits, sizeof(infobits));
} }
else else
...@@ -474,7 +469,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file, ...@@ -474,7 +469,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file,
return -EFAULT; return -EFAULT;
if (!info.hamming && !info.notfound) if (!info.hamming && !info.notfound)
{ {
t->is_searching[req->pgbuf] = FALSE; t->is_searching[req->pgbuf] = false;
} }
return 0; return 0;
} }
...@@ -530,8 +525,8 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file, ...@@ -530,8 +525,8 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file,
if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS) if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS)
return -EINVAL; return -EINVAL;
t->vdau[req->pgbuf].stopped = TRUE; t->vdau[req->pgbuf].stopped = true;
t->is_searching[req->pgbuf] = FALSE; t->is_searching[req->pgbuf] = false;
return 0; return 0;
} }
...@@ -660,11 +655,11 @@ static int saa5249_open(struct inode *inode, struct file *file) ...@@ -660,11 +655,11 @@ static int saa5249_open(struct inode *inode, struct file *file)
memset(t->vdau[pgbuf].sregs, 0, sizeof(t->vdau[0].sregs)); memset(t->vdau[pgbuf].sregs, 0, sizeof(t->vdau[0].sregs));
memset(t->vdau[pgbuf].laststat, 0, sizeof(t->vdau[0].laststat)); memset(t->vdau[pgbuf].laststat, 0, sizeof(t->vdau[0].laststat));
t->vdau[pgbuf].expire = 0; t->vdau[pgbuf].expire = 0;
t->vdau[pgbuf].clrfound = TRUE; t->vdau[pgbuf].clrfound = true;
t->vdau[pgbuf].stopped = TRUE; t->vdau[pgbuf].stopped = true;
t->is_searching[pgbuf] = FALSE; t->is_searching[pgbuf] = false;
} }
t->virtual_mode=FALSE; t->virtual_mode = false;
return 0; return 0;
fail: fail:
......
...@@ -120,9 +120,9 @@ static inline int i2c_is_error(enum i2c_status status) ...@@ -120,9 +120,9 @@ static inline int i2c_is_error(enum i2c_status status)
case ARB_LOST: case ARB_LOST:
case SEQ_ERR: case SEQ_ERR:
case ST_ERR: case ST_ERR:
return TRUE; return true;
default: default:
return FALSE; return false;
} }
} }
...@@ -131,9 +131,9 @@ static inline int i2c_is_idle(enum i2c_status status) ...@@ -131,9 +131,9 @@ static inline int i2c_is_idle(enum i2c_status status)
switch (status) { switch (status) {
case IDLE: case IDLE:
case DONE_STOP: case DONE_STOP:
return TRUE; return true;
default: default:
return FALSE; return false;
} }
} }
...@@ -141,9 +141,9 @@ static inline int i2c_is_busy(enum i2c_status status) ...@@ -141,9 +141,9 @@ static inline int i2c_is_busy(enum i2c_status status)
{ {
switch (status) { switch (status) {
case BUSY: case BUSY:
return TRUE; return true;
default: default:
return FALSE; return false;
} }
} }
...@@ -159,8 +159,8 @@ static int i2c_is_busy_wait(struct saa7134_dev *dev) ...@@ -159,8 +159,8 @@ static int i2c_is_busy_wait(struct saa7134_dev *dev)
saa_wait(I2C_WAIT_DELAY); saa_wait(I2C_WAIT_DELAY);
} }
if (I2C_WAIT_RETRY == count) if (I2C_WAIT_RETRY == count)
return FALSE; return false;
return TRUE; return true;
} }
static int i2c_reset(struct saa7134_dev *dev) static int i2c_reset(struct saa7134_dev *dev)
...@@ -171,7 +171,7 @@ static int i2c_reset(struct saa7134_dev *dev) ...@@ -171,7 +171,7 @@ static int i2c_reset(struct saa7134_dev *dev)
d2printk(KERN_DEBUG "%s: i2c reset\n",dev->name); d2printk(KERN_DEBUG "%s: i2c reset\n",dev->name);
status = i2c_get_status(dev); status = i2c_get_status(dev);
if (!i2c_is_error(status)) if (!i2c_is_error(status))
return TRUE; return true;
i2c_set_status(dev,status); i2c_set_status(dev,status);
for (count = 0; count < I2C_WAIT_RETRY; count++) { for (count = 0; count < I2C_WAIT_RETRY; count++) {
...@@ -181,13 +181,13 @@ static int i2c_reset(struct saa7134_dev *dev) ...@@ -181,13 +181,13 @@ static int i2c_reset(struct saa7134_dev *dev)
udelay(I2C_WAIT_DELAY); udelay(I2C_WAIT_DELAY);
} }
if (I2C_WAIT_RETRY == count) if (I2C_WAIT_RETRY == count)
return FALSE; return false;
if (!i2c_is_idle(status)) if (!i2c_is_idle(status))
return FALSE; return false;
i2c_set_attr(dev,NOP); i2c_set_attr(dev,NOP);
return TRUE; return true;
} }
static inline int i2c_send_byte(struct saa7134_dev *dev, static inline int i2c_send_byte(struct saa7134_dev *dev,
......
...@@ -45,12 +45,6 @@ ...@@ -45,12 +45,6 @@
#include <media/video-buf-dvb.h> #include <media/video-buf-dvb.h>
#endif #endif
#ifndef TRUE
# define TRUE (1==1)
#endif
#ifndef FALSE
# define FALSE (1==0)
#endif
#define UNSET (-1U) #define UNSET (-1U)
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
......
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