[PATCH] drivers/media/video: Convert to generic boolean-values

2007-01-26 Thread Richard Knutsson
Signed-off-by: Richard Knutsson <[EMAIL PROTECTED]>
---
Compile-tested with "allyes", "allmod" & "allno" on i386.

 saa5246a.c|   10 +-
 saa5246a.h|9 ++---
 saa5249.c |   41 ++---
 saa7134/saa7134-i2c.c |   24 
 saa7134/saa7134.h |6 --
 5 files changed, 37 insertions(+), 53 deletions(-)


diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c
index 77bb940..28802c3 100644
--- a/drivers/media/video/saa5246a.c
+++ b/drivers/media/video/saa5246a.c
@@ -112,7 +112,7 @@ static int saa5246a_attach(struct i2c_adapter *adap, int 
addr, int kind)
for (pgbuf = 0; pgbuf < NUM_DAUS; pgbuf++)
{
memset(t->pgbuf[pgbuf], ' ', sizeof(t->pgbuf[0]));
-   t->is_searching[pgbuf] = FALSE;
+   t->is_searching[pgbuf] = false;
}
vd->priv=t;
 
@@ -199,7 +199,7 @@ static int i2c_senddata(struct saa5246a_device *t, ...)
 
 /* Get count number of bytes from I²C-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 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 I²C-device didn't send
  * acknowledge, 0 otherwise
  */
@@ -339,7 +339,7 @@ static int saa5246a_request_page(struct saa5246a_device *t,
return -EIO;
}
 
-   t->is_searching[req->pgbuf] = TRUE;
+   t->is_searching[req->pgbuf] = true;
return 0;
 }
 
@@ -453,7 +453,7 @@ static inline int saa5246a_get_status(struct 
saa5246a_device *t,
}
}
if (!info->hamming && !info->notfound)
-   t->is_searching[dau_no] = FALSE;
+   t->is_searching[dau_no] = false;
return 0;
 }
 
@@ -565,7 +565,7 @@ static inline int saa5246a_stop_dau(struct saa5246a_device 
*t,
{
return -EIO;
}
-   t->is_searching[dau_no] = FALSE;
+   t->is_searching[dau_no] = false;
return 0;
 }
 
diff --git a/drivers/media/video/saa5246a.h b/drivers/media/video/saa5246a.h
index 7b91112..64394c0 100644
--- a/drivers/media/video/saa5246a.h
+++ b/drivers/media/video/saa5246a.h
@@ -41,23 +41,18 @@
 #define POS_HEADER_START 7
 #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 */
 #define REQ_CONTAINS_TIME(p_req) \
((p_req)->start <= POS_TIME_END && \
 (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 */
 #define REQ_CONTAINS_HEADER(p_req) \
((p_req)->start <= POS_HEADER_END && \
 (p_req)->end   >= POS_HEADER_START)
 
-#ifndef FALSE
-#define FALSE 0
-#define TRUE 1
-#endif
-
 /*/
 /* Mode register numbers of the SAA5246A*/
 /*/
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c
index bb3fb43..19f4503 100644
--- a/drivers/media/video/saa5249.c
+++ b/drivers/media/video/saa5249.c
@@ -124,11 +124,6 @@ struct saa5249_device
 
 /* General defines and debugging support */
 
-#ifndef FALSE
-#define FALSE 0
-#define TRUE 1
-#endif
-
 #define RESCHED do { cond_resched(); } while(0)
 
 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)
memset(t->vdau[pgbuf].sregs, 0, sizeof(t->vdau[0].sregs));
memset(t->vdau[pgbuf].laststat, 0, sizeof(t->vdau[0].laststat));
t->vdau[pgbuf].expire = 0;
-   t->vdau[pgbuf].clrfound = TRUE;
-   t->vdau[pgbuf].stopped = TRUE;
-   t->is_searching[pgbuf] = FALSE;
+   t->vdau[pgbuf].clrfound = true;
+   t->vdau[pgbuf].stopped = true;
+   t->is_searching[pgbuf] = false;
}
vd->priv=t;
 
@@ -298,7 +293,7 @@ static int i2c_senddata(struct saa5249_device *t, ...)
 
 /* Get count number of bytes from I²C-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
- * 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 I²C-device didn't send acknowledge, 0 

[PATCH] drivers/media/video: Convert to generic boolean-values

2007-01-26 Thread Richard Knutsson
Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Compile-tested with allyes, allmod  allno on i386.

 saa5246a.c|   10 +-
 saa5246a.h|9 ++---
 saa5249.c |   41 ++---
 saa7134/saa7134-i2c.c |   24 
 saa7134/saa7134.h |6 --
 5 files changed, 37 insertions(+), 53 deletions(-)


diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c
index 77bb940..28802c3 100644
--- a/drivers/media/video/saa5246a.c
+++ b/drivers/media/video/saa5246a.c
@@ -112,7 +112,7 @@ static int saa5246a_attach(struct i2c_adapter *adap, int 
addr, int kind)
for (pgbuf = 0; pgbuf  NUM_DAUS; pgbuf++)
{
memset(t-pgbuf[pgbuf], ' ', sizeof(t-pgbuf[0]));
-   t-is_searching[pgbuf] = FALSE;
+   t-is_searching[pgbuf] = false;
}
vd-priv=t;
 
@@ -199,7 +199,7 @@ static int i2c_senddata(struct saa5246a_device *t, ...)
 
 /* Get count number of bytes from I²C-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 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 I²C-device didn't send
  * acknowledge, 0 otherwise
  */
@@ -339,7 +339,7 @@ static int saa5246a_request_page(struct saa5246a_device *t,
return -EIO;
}
 
-   t-is_searching[req-pgbuf] = TRUE;
+   t-is_searching[req-pgbuf] = true;
return 0;
 }
 
@@ -453,7 +453,7 @@ static inline int saa5246a_get_status(struct 
saa5246a_device *t,
}
}
if (!info-hamming  !info-notfound)
-   t-is_searching[dau_no] = FALSE;
+   t-is_searching[dau_no] = false;
return 0;
 }
 
@@ -565,7 +565,7 @@ static inline int saa5246a_stop_dau(struct saa5246a_device 
*t,
{
return -EIO;
}
-   t-is_searching[dau_no] = FALSE;
+   t-is_searching[dau_no] = false;
return 0;
 }
 
diff --git a/drivers/media/video/saa5246a.h b/drivers/media/video/saa5246a.h
index 7b91112..64394c0 100644
--- a/drivers/media/video/saa5246a.h
+++ b/drivers/media/video/saa5246a.h
@@ -41,23 +41,18 @@
 #define POS_HEADER_START 7
 #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 */
 #define REQ_CONTAINS_TIME(p_req) \
((p_req)-start = POS_TIME_END  \
 (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 */
 #define REQ_CONTAINS_HEADER(p_req) \
((p_req)-start = POS_HEADER_END  \
 (p_req)-end   = POS_HEADER_START)
 
-#ifndef FALSE
-#define FALSE 0
-#define TRUE 1
-#endif
-
 /*/
 /* Mode register numbers of the SAA5246A*/
 /*/
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c
index bb3fb43..19f4503 100644
--- a/drivers/media/video/saa5249.c
+++ b/drivers/media/video/saa5249.c
@@ -124,11 +124,6 @@ struct saa5249_device
 
 /* General defines and debugging support */
 
-#ifndef FALSE
-#define FALSE 0
-#define TRUE 1
-#endif
-
 #define RESCHED do { cond_resched(); } while(0)
 
 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)
memset(t-vdau[pgbuf].sregs, 0, sizeof(t-vdau[0].sregs));
memset(t-vdau[pgbuf].laststat, 0, sizeof(t-vdau[0].laststat));
t-vdau[pgbuf].expire = 0;
-   t-vdau[pgbuf].clrfound = TRUE;
-   t-vdau[pgbuf].stopped = TRUE;
-   t-is_searching[pgbuf] = FALSE;
+   t-vdau[pgbuf].clrfound = true;
+   t-vdau[pgbuf].stopped = true;
+   t-is_searching[pgbuf] = false;
}
vd-priv=t;
 
@@ -298,7 +293,7 @@ static int i2c_senddata(struct saa5249_device *t, ...)
 
 /* Get count number of bytes from I²C-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
- * 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 I²C-device didn't send acknowledge, 0 otherwise
  */
 
@@ -317,7 +312,7 @@ static int