[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8c1e6d90-c394-4d98-96f9-eff526a987ed@xs4all.nl>
Date: Fri, 25 Apr 2025 10:51:56 +0200
From: Hans Verkuil <hverkuil@...all.nl>
To: Kuan-Wei Chiu <visitorckw@...il.com>, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
jk@...abs.org, joel@....id.au, eajames@...ux.ibm.com,
andrzej.hajda@...el.com, neil.armstrong@...aro.org, rfoss@...nel.org,
maarten.lankhorst@...ux.intel.com, mripard@...nel.org, tzimmermann@...e.de,
airlied@...il.com, simona@...ll.ch, dmitry.torokhov@...il.com,
mchehab@...nel.org, awalls@...metrocast.net, hverkuil@...all.nl,
miquel.raynal@...tlin.com, richard@....at, vigneshr@...com,
louis.peens@...igine.com, andrew+netdev@...n.ch, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com, parthiban.veerasooran@...rochip.com,
arend.vanspriel@...adcom.com, johannes@...solutions.net,
gregkh@...uxfoundation.org, jirislaby@...nel.org, yury.norov@...il.com,
akpm@...ux-foundation.org, jdelvare@...e.com, linux@...ck-us.net,
alexandre.belloni@...tlin.com, pgaj@...ence.com
Cc: hpa@...or.com, alistair@...ple.id.au, linux@...musvillemoes.dk,
Laurent.pinchart@...asonboard.com, jonas@...boo.se,
jernej.skrabec@...il.com, kuba@...nel.org, linux-kernel@...r.kernel.org,
linux-fsi@...ts.ozlabs.org, dri-devel@...ts.freedesktop.org,
linux-input@...r.kernel.org, linux-media@...r.kernel.org,
linux-mtd@...ts.infradead.org, oss-drivers@...igine.com,
netdev@...r.kernel.org, linux-wireless@...r.kernel.org,
brcm80211@...ts.linux.dev, brcm80211-dev-list.pdl@...adcom.com,
linux-serial@...r.kernel.org, bpf@...r.kernel.org, jserv@...s.ncku.edu.tw,
Frank.Li@....com, linux-hwmon@...r.kernel.org,
linux-i3c@...ts.infradead.org, david.laight.linux@...il.com,
andrew.cooper3@...rix.com, Yu-Chun Lin <eleanor15x@...il.com>
Subject: Re: [PATCH v4 04/13] media: saa7115: Replace open-coded parity
calculation with parity_odd()
On 09/04/2025 17:43, Kuan-Wei Chiu wrote:
> Refactor parity calculations to use the standard parity_odd() helper.
> This change eliminates redundant implementations.
>
> Co-developed-by: Yu-Chun Lin <eleanor15x@...il.com>
> Signed-off-by: Yu-Chun Lin <eleanor15x@...il.com>
> Signed-off-by: Kuan-Wei Chiu <visitorckw@...il.com>
Reviewed-by: Hans Verkuil <hverkuil@...all.nl>
Regards,
Hans
> ---
> drivers/media/i2c/saa7115.c | 12 ++----------
> 1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c
> index a1c71187e773..a7886269dcfc 100644
> --- a/drivers/media/i2c/saa7115.c
> +++ b/drivers/media/i2c/saa7115.c
> @@ -25,6 +25,7 @@
>
> #include "saa711x_regs.h"
>
> +#include <linux/bitops.h>
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <linux/slab.h>
> @@ -664,15 +665,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[] = {
> @@ -1227,7 +1219,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 (!parity_odd(p[0]) || !parity_odd(p[1]))
> return 0;
> vbi->type = V4L2_SLICED_CAPTION_525;
> break;
Powered by blists - more mailing lists