From patchwork Wed Apr 9 15:43:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuan-Wei Chiu X-Patchwork-Id: 2070663 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=ZlcDsz4K; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=SX+laNAt; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=J6p4oq2X; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4ZXnMX690Yz1yJK for ; Thu, 10 Apr 2025 01:45:12 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=87rU9X9aqj7orJAt73GsXlWi4fEI2PKFB/hPsHeAxoY=; b=ZlcDsz4KgcHzRp Z6u8en2oeGdN96qHJvHf4LNe5Dl/QbrORGZ2WHcaP+unQ5DGjzgrxEE47jpGI7r4QGTI1F+VQcaCQ DWN3poPP0s6W8mRUPHeRaSW+p8NQcTnB+IWgJ4iOmq8mwURmMJgKwRrwMTAcXa9oS2JKhDkQxh2oi tOXxbdLO6yF+eOWHmApPUKLivW0ErROIqfHR+2HgWf8lfIVJ/lW5DrRLjC8YBPcK2kaYnkqCsdjF0 7rw82co1cT694OoZwTOYBohOh2WkZCJP9ipWkwosFDLnIc7m4zQroBhzhiwURxCqSUPxG6qeE0WPj MryTRExG/HhZ8EG7AYdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u2XcA-00000007kRw-0ffH; Wed, 09 Apr 2025 15:45:22 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u2Xc8-00000007kQo-0Q5N; Wed, 09 Apr 2025 15:45:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=0vmckaFkj9v1ziFLew45kxKFqGeGwuFVGwp5LAE34T4=; b=SX+laNAtT/VetSLcW986Xih6QA B15VYT34cv6D2Kocgu8HXyik82Fy4TftcT3+siV3M3AJtrTJHvGxFGa73sotPZht5QompEkmdH0KK COODL6as6FhZDXF+/dB/IY1RWGkztjprb/l1LIXzc4L6bmPn+m+t09GjJ+bv5CCVx2SzaeICnCqsk lz7CIJEVYStHWovRCSd9ELMYxFWS9IBUFXUAuhF0To2uXBc8hSgwYW7+9eGOVbevjmGHN/UqLnBOM ojM59ZHtFIQo+bgICaisCBMrCexTX1JKMtv5KInl6wsgwu1aHpWJfn9S00g1ST92ZzxYbhhnPizaM r4nQrM2A==; Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by desiato.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1u2Xc4-00000008e6S-2odG; Wed, 09 Apr 2025 15:45:18 +0000 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-3054ef26da3so5600087a91.3; Wed, 09 Apr 2025 08:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744213513; x=1744818313; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0vmckaFkj9v1ziFLew45kxKFqGeGwuFVGwp5LAE34T4=; b=J6p4oq2Xh+L2/fAUQu4bgG4JPBlzAY2rv+FfHPxYB5tB9orTfVoYE7n4nZ7E22SKlh ctFoagxbNPbGHaICCCF6/OudoUABrdpBrxEusLM+KQSFLqDBvodXiqP//mDExwCgnzQB iQ+6KnyUw+b5xC4uwPxxEDGdlaTWIN7OgmbTHngUXvPqFhiWRR1ZpHpb4wl8uFk3X+8h cA6jYK+HeZ54VJ2+c1H9tovI/0xX4aha0SyF6muBNSY5XI1bPWO17g9GMrxewgKmGm9c wwy+icqgtBtMhoXwodm1aWaRYnZ/dLKaQyKkwtKRx2lQpdGlbCPsWEu658LfHErDJfQS iHSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744213513; x=1744818313; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0vmckaFkj9v1ziFLew45kxKFqGeGwuFVGwp5LAE34T4=; b=bhYx6NnLIxT9rI8UHNy2ShgLZwSWgEq0VwrC2uK85jDk8EAeqeR3ka+an7NaWL0ffW ZDfxXbDcLu73sUe2TeDqba8KpOliL4iFu3JWB683gVQWUFPraZUxtgYL5f8R83ezwErv tYl76gnteleaFsOLbjEwNmTw8HqSQ/GkNfGZQr0aoE1+uaxsoiRHzC8w9+SYaQOIjnLi IHlJrRDpCOwDFXc4PRriDudlZSC3bMP5BwZklMK1S1fyo2uzT6XzCaJH57XKFngZKf5R NuuSoOmjFq/jwqJgncukpGuT366/3yu8GkI+0A0Nr6PVutuQ6oR4YSvlzPKJ5VYvm8mS i0xQ== X-Forwarded-Encrypted: i=1; AJvYcCUV/6WL97md5BcYbhTbgaRMTWR9SJgazuGor/thEBrcBqc3e74pV05a1M0bS13r3q1GhDOthA7/BINa@lists.infradead.org, AJvYcCVsio0WPXK+/56sB9QUvTy5gtdvJMjH7VVQpCKIjriBrYDNRnwzNRmvvCc/WIELAlElfqTsdf8yHeo=@lists.infradead.org X-Gm-Message-State: AOJu0Yx1WV3Ee9vMGL0olLaSYoMa49ABJ+GEOZwUPT79Akf3yKFuUxOq /aS/RoscnO3kt1MtJyyV6FlQKqQeultATXbtUFSuKkBjgjg7ICyX X-Gm-Gg: ASbGncvK3cfRu8DoIZ0pWPnP7uFAwbmofFLjUxS+LmwPM5Fa70y4Sd3grC4aTF7EUlS mO9JJI90u2EupiCIbwoSz0H1jIzud9LMOkpv7FGJceXUnZ71I+SKRZiVpubknl5lmYqBSbv6p9p vKuOykuQyeLCJT9xDhNJ6INBYVsISZKPjWVLENqh2yV3viG6f2RMVU0j5Cb9xADsl5lpuNVFHu9 ei5HcvnnOipRXut7YZQSzZRpldyjjTkULH0BPzJDyMsLDM5KViejC+J+R9MiQoIUT8KwZSqA+8D YimlAZgoZwOqV7ktWK4pa/0ntX0V9Hqd7C2rbyCFI7KF5OQYP7WjCqxsBNNrPuDu6S8O5N4= X-Google-Smtp-Source: AGHT+IFGakXWHWi8mPXKxnYyjY+QGe+hrJ1DKxm8mqQTtmCR5lZ2ol4+lqNevSMOwq7LjWocz+r/eA== X-Received: by 2002:a17:90a:da88:b0:2f9:c139:b61f with SMTP id 98e67ed59e1d1-306dbbb557amr5410743a91.14.1744213513621; Wed, 09 Apr 2025 08:45:13 -0700 (PDT) Received: from visitorckw-System-Product-Name.. ([140.113.216.168]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-306dd171991sm1952304a91.37.2025.04.09.08.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Apr 2025 08:45:13 -0700 (PDT) From: Kuan-Wei Chiu To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, jk@ozlabs.org, joel@jms.id.au, eajames@linux.ibm.com, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, dmitry.torokhov@gmail.com, mchehab@kernel.org, awalls@md.metrocast.net, hverkuil@xs4all.nl, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, louis.peens@corigine.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, parthiban.veerasooran@microchip.com, arend.vanspriel@broadcom.com, johannes@sipsolutions.net, gregkh@linuxfoundation.org, jirislaby@kernel.org, yury.norov@gmail.com, akpm@linux-foundation.org, jdelvare@suse.com, linux@roeck-us.net, alexandre.belloni@bootlin.com, pgaj@cadence.com Cc: hpa@zytor.com, alistair@popple.id.au, linux@rasmusvillemoes.dk, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, kuba@kernel.org, linux-kernel@vger.kernel.org, linux-fsi@lists.ozlabs.org, dri-devel@lists.freedesktop.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-mtd@lists.infradead.org, oss-drivers@corigine.com, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211@lists.linux.dev, brcm80211-dev-list.pdl@broadcom.com, linux-serial@vger.kernel.org, bpf@vger.kernel.org, jserv@ccns.ncku.edu.tw, Frank.Li@nxp.com, linux-hwmon@vger.kernel.org, linux-i3c@lists.infradead.org, david.laight.linux@gmail.com, andrew.cooper3@citrix.com, Kuan-Wei Chiu , Yu-Chun Lin Subject: [PATCH v4 04/13] media: saa7115: Replace open-coded parity calculation with parity_odd() Date: Wed, 9 Apr 2025 23:43:47 +0800 Message-Id: <20250409154356.423512-5-visitorckw@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250409154356.423512-1-visitorckw@gmail.com> References: <20250409154356.423512-1-visitorckw@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250409_164516_815404_86EE7F25 X-CRM114-Status: UNSURE ( 9.71 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Refactor parity calculations to use the standard parity_odd() helper. This change eliminates redundant implementations. Co-developed-by: Yu-Chun Lin Signed-off-by: Yu-Chun Lin Signed-off-by: Kuan-Wei Chiu --- drivers/media/i2c/saa7115.c | 12 ++ 1 file changed, 2 insertions(+), 10 deletions(-) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [visitorckw(at)gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1032 listed in] [list.dnswl.org] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Refactor parity calculations to use the standard parity_odd() helper. This change eliminates redundant implementations. Co-developed-by: Yu-Chun Lin Signed-off-by: Yu-Chun Lin Signed-off-by: Kuan-Wei Chiu Reviewed-by: Hans Verkuil --- 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 #include #include #include @@ -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;