summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-02-28 16:48:27 -0500
committerAndy Walls <awalls@radix.net>2009-02-28 16:48:27 -0500
commit6f74c341a7b249eb9d00d02c979b5b646f6838f3 (patch)
treec941a62b4bfe9fe2409b2eedffb9cdfcd54e2665
parent6027e12e8c84fefb63c5e8a3cfcf1e672629a439 (diff)
downloadmediapointer-dvb-s2-6f74c341a7b249eb9d00d02c979b5b646f6838f3.tar.gz
mediapointer-dvb-s2-6f74c341a7b249eb9d00d02c979b5b646f6838f3.tar.bz2
cx18: Fix s-parse warnings and a logic error about extracting the VBI PTS
From: Andy Walls <awalls@radix.net> My s-parse builds never griped about be32_to_cpu() casting to __be32, but Hans' builds did. This change explictly declares the pointer into the VBI buffer header as __be32, which is the correct thing to do as the data is always big endian when we go to fetch it. Hopefully this will quiet s-parse warnings. Also corrected a misplaced parenthesis logic error in checking for the VBI header magic number. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
-rw-r--r--linux/drivers/media/video/cx18/cx18-vbi.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-vbi.c b/linux/drivers/media/video/cx18/cx18-vbi.c
index a81fe2e98..355737bff 100644
--- a/linux/drivers/media/video/cx18/cx18-vbi.c
+++ b/linux/drivers/media/video/cx18/cx18-vbi.c
@@ -169,7 +169,7 @@ void cx18_process_vbi_data(struct cx18 *cx, struct cx18_buffer *buf,
int streamtype)
{
u8 *p = (u8 *) buf->buf;
- u32 *q = (u32 *) buf->buf;
+ __be32 *q = (__be32 *) buf->buf;
u32 size = buf->bytesused;
u32 pts;
int lines;
@@ -178,8 +178,9 @@ void cx18_process_vbi_data(struct cx18 *cx, struct cx18_buffer *buf,
return;
/*
- * The CX23418 sends us data that is 32 bit LE swapped, but we want
- * the raw VBI bytes in the order they were in the raster line
+ * The CX23418 sends us data that is 32 bit little-endian swapped,
+ * but we want the raw VBI bytes in the order they were in the raster
+ * line. This has a side effect of making the 12 byte header big endian
*/
cx18_buf_swap(buf);
@@ -218,7 +219,7 @@ void cx18_process_vbi_data(struct cx18 *cx, struct cx18_buffer *buf,
/* Sliced VBI data with data insertion */
- pts = (be32_to_cpu(q[0] == 0x3fffffff)) ? be32_to_cpu(q[2]) : 0;
+ pts = (be32_to_cpu(q[0]) == 0x3fffffff) ? be32_to_cpu(q[2]) : 0;
/*
* For calls to compress_sliced_buf(), ensure there are an integral