diff options
Diffstat (limited to 'drivers/media/pci/cx18/cx18-av-vbi.c')
| -rw-r--r-- | drivers/media/pci/cx18/cx18-av-vbi.c | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/drivers/media/pci/cx18/cx18-av-vbi.c b/drivers/media/pci/cx18/cx18-av-vbi.c index a002537a387d..f9beeaeaa1cb 100644 --- a/drivers/media/pci/cx18/cx18-av-vbi.c +++ b/drivers/media/pci/cx18/cx18-av-vbi.c @@ -1,22 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * cx18 ADEC VBI functions * * Derived from cx25840-vbi.c * - * Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Copyright (C) 2007 Hans Verkuil <hverkuil@kernel.org> */ +#include <linux/bitops.h> #include "cx18-driver.h" /* @@ -60,20 +52,11 @@ struct vbi_anc_data { u8 sdid; u8 data_count; u8 idid[2]; - u8 payload[1]; /* data_count of payload */ + u8 payload[]; /* data_count of payload */ /* u8 checksum; */ /* u8 fill[]; Variable number of fill bytes */ }; -static int odd_parity(u8 c) -{ - c ^= (c >> 4); - c ^= (c >> 2); - c ^= (c >> 1); - - return c & 1; -} - static int decode_vps(u8 *dst, u8 *p) { static const u8 biphase_tbl[] = { @@ -287,7 +270,7 @@ int cx18_av_decode_vbi_line(struct v4l2_subdev *sd, break; case 6: sdid = V4L2_SLICED_CAPTION_525; - err = !odd_parity(p[0]) || !odd_parity(p[1]); + err = !parity8(p[0]) || !parity8(p[1]); break; case 9: sdid = V4L2_SLICED_VPS; |
