[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9a626ceb-4ee2-56a2-9046-9bc9bce4e1e8@xs4all.nl>
Date: Fri, 1 Jul 2016 13:53:21 +0200
From: Hans Verkuil <hverkuil@...all.nl>
To: zengzhaoxiu@....com, linux-kernel@...r.kernel.org
Cc: Zhaoxiu Zeng <zhaoxiu.zeng@...il.com>,
Mauro Carvalho Chehab <mchehab@....samsung.com>,
Krzysztof Kozlowski <k.kozlowski@...sung.com>,
Arnd Bergmann <arnd@...db.de>, linux-media@...r.kernel.org
Subject: Re: [patch V4 14/31] media: use parity functions in saa7115
On 05/11/2016 11:19 AM, zengzhaoxiu@....com wrote:
> From: Zhaoxiu Zeng <zhaoxiu.zeng@...il.com>
>
> Signed-off-by: Zhaoxiu Zeng <zhaoxiu.zeng@...il.com>
Acked-by: Hans Verkuil <hans.verkuil@...co.com>
Thanks,
Hans
> ---
> drivers/media/i2c/saa7115.c | 17 ++---------------
> 1 file changed, 2 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c
> index d2a1ce2..4c22df8 100644
> --- a/drivers/media/i2c/saa7115.c
> +++ b/drivers/media/i2c/saa7115.c
> @@ -672,15 +672,6 @@ static const unsigned char saa7115_init_misc[] = {
> 0x00, 0x00
> };
>
> -static int saa711x_odd_parity(u8 c)
> -{
> - c ^= (c >> 4);
> - c ^= (c >> 2);
> - c ^= (c >> 1);
> -
> - return c & 1;
> -}
> -
> static int saa711x_decode_vps(u8 *dst, u8 *p)
> {
> static const u8 biphase_tbl[] = {
> @@ -733,7 +724,6 @@ static int saa711x_decode_wss(u8 *p)
> static const int wss_bits[8] = {
> 0, 0, 0, 1, 0, 1, 1, 1
> };
> - unsigned char parity;
> int wss = 0;
> int i;
>
> @@ -745,11 +735,8 @@ static int saa711x_decode_wss(u8 *p)
> return -1;
> wss |= b2 << i;
> }
> - parity = wss & 15;
> - parity ^= parity >> 2;
> - parity ^= parity >> 1;
>
> - if (!(parity & 1))
> + if (!parity4(wss))
> return -1;
>
> return wss;
> @@ -1235,7 +1222,7 @@ static int saa711x_decode_vbi_line(struct v4l2_subdev *sd, struct v4l2_decode_vb
> vbi->type = V4L2_SLICED_TELETEXT_B;
> break;
> case 4:
> - if (!saa711x_odd_parity(p[0]) || !saa711x_odd_parity(p[1]))
> + if (!parity8(p[0]) || !parity8(p[1]))
> return 0;
> vbi->type = V4L2_SLICED_CAPTION_525;
> break;
>
Powered by blists - more mailing lists