Commit 583803d1 authored by Andy Walls's avatar Andy Walls Committed by Mauro Carvalho Chehab

V4L/DVB (10853): cx18: Fix s-parse warnings and a logic error about extracting the VBI PTS

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.
Signed-off-by: default avatarAndy Walls <awalls@radix.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 386e439f
...@@ -169,7 +169,7 @@ void cx18_process_vbi_data(struct cx18 *cx, struct cx18_buffer *buf, ...@@ -169,7 +169,7 @@ void cx18_process_vbi_data(struct cx18 *cx, struct cx18_buffer *buf,
int streamtype) int streamtype)
{ {
u8 *p = (u8 *) buf->buf; u8 *p = (u8 *) buf->buf;
u32 *q = (u32 *) buf->buf; __be32 *q = (__be32 *) buf->buf;
u32 size = buf->bytesused; u32 size = buf->bytesused;
u32 pts; u32 pts;
int lines; int lines;
...@@ -178,8 +178,9 @@ void cx18_process_vbi_data(struct cx18 *cx, struct cx18_buffer *buf, ...@@ -178,8 +178,9 @@ void cx18_process_vbi_data(struct cx18 *cx, struct cx18_buffer *buf,
return; return;
/* /*
* The CX23418 sends us data that is 32 bit LE swapped, but we want * The CX23418 sends us data that is 32 bit little-endian swapped,
* the raw VBI bytes in the order they were in the raster line * 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); cx18_buf_swap(buf);
...@@ -218,7 +219,7 @@ void cx18_process_vbi_data(struct cx18 *cx, struct cx18_buffer *buf, ...@@ -218,7 +219,7 @@ void cx18_process_vbi_data(struct cx18 *cx, struct cx18_buffer *buf,
/* Sliced VBI data with data insertion */ /* 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 * For calls to compress_sliced_buf(), ensure there are an integral
......
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