From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0253C7EE39 for ; Mon, 23 Jun 2025 19:42:31 +0000 (UTC) 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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Q0lDlxl+3alNr6eRKo6S7MhUXpErS4kjDiMA3oi82wI=; b=ZpEfIG7l6yZmO8 MUZ++JJIQpXq+mL4cRHUZapHcjU6VshsvFDX651fI9Fwijhh92L2M3FUBTyLVsjxPVkts0xEHzDhv sdMv58TbLoLqbGPV1ocMZWM22gtcJ+B+JX8yITatm1STkWad1vKe6UFgY590zJebJWTCiV2VUBeGp kO64up0gU821MtfXjry/IWRSpfcbmjVS8R2MVtOXGRNJ756iTwZxKh1Ydc3YjV+AGT90EQCAz/S4y IEFhkVWVkYgHhNFK/LOvk7sll/JtfETIjlKiS4Qw+BDHApPcx7ugmrPI/KAaVntnqzyyodm0Zn64k KRRH60xXEnBd7pQwOfNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uTn3n-00000003pq3-1vPB; Mon, 23 Jun 2025 19:42:31 +0000 Received: from sender4-op-o12.zoho.com ([136.143.188.12]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uTjhe-00000003Lth-1rL6; Mon, 23 Jun 2025 16:07:27 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1750694804; cv=none; d=zohomail.com; s=zohoarc; b=K7Q9tgTPlrIc9XNYWTYRVlRSai0pFbuSJBorOUBNIPY+oau4zgiPxYEPgOj8b2qnkhmolRvPH5enkTvGWEP8CfkkD+e6/mUYipWKby326nfUB8MVqCtaUOhiFSAG88cFax44NSlWZSKguDkiU7u4zzj3uOacH37glMUqADa+oXE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750694804; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=eoA5RXMl12cHfJONoAaxIbWb/2Djy5r2aatx6D/qAxo=; b=HbXlrW8MrBx0rnm8dd4j7pONXrgIvkSg1FnQNPCRmUJVxbOttZJ0LbPfdkrJg19QndoYY8kfmVvTmqF9QldXWFIXdDdWq5xn6CMd62ZmSsRvUZm5fyeQgo5+/9o2zFNZyXNAXZQfn69TKuM31u1yTckVWDB/8R5tV4+xfyM0KE8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=nicolas.frattaroli@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1750694804; s=zohomail; d=collabora.com; i=nicolas.frattaroli@collabora.com; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:References:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=eoA5RXMl12cHfJONoAaxIbWb/2Djy5r2aatx6D/qAxo=; b=QvgjscK7NnhGzdZiOG35gHcfkGdacKLZFwgfE0aGSYu8uPGwjo+tyhWyXB6xOyne lw67O2p25ysKrn2t9PSo7DlJ2VuZwYI/1ByZvm7P9DxxAoCSbeWrylAF0R1nit8F6ft If+wtiFp6uGNcF26F450h8UeFojBEtLUJaFM46Ew= Received: by mx.zohomail.com with SMTPS id 1750694802450300.9211032358951; Mon, 23 Jun 2025 09:06:42 -0700 (PDT) From: Nicolas Frattaroli Date: Mon, 23 Jun 2025 18:05:32 +0200 Subject: [PATCH v2 04/20] media: synopsys: hdmirx: replace macros with bitfield variants MIME-Version: 1.0 Message-Id: <20250623-byeword-update-v2-4-cf1fc08a2e1f@collabora.com> References: <20250623-byeword-update-v2-0-cf1fc08a2e1f@collabora.com> In-Reply-To: <20250623-byeword-update-v2-0-cf1fc08a2e1f@collabora.com> To: Yury Norov , Rasmus Villemoes , Jaehoon Chung , Ulf Hansson , Heiko Stuebner , Shreeya Patel , Mauro Carvalho Chehab , Sandy Huang , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Vinod Koul , Kishon Vijay Abraham I , Nicolas Frattaroli , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Shawn Lin , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Chanwoo Choi , MyungJoo Ham , Kyungmin Park , Qin Jian , Michael Turquette , Stephen Boyd , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-phy@lists.infradead.org, linux-sound@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, linux-clk@vger.kernel.org, llvm@lists.linux.dev, Nicolas Frattaroli X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250623_090726_539567_E0630481 X-CRM114-Status: GOOD ( 13.48 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org The era of hand-rolled HIWORD_UPDATE macros is over, at least for those drivers that use constant masks. Replace the UPDATE macro with bitfield.h's FIELD_PREP, to give us additional error checking. Also, replace the HIWORD_UPDATE macro at the same time with the new FIELD_PREP_WM16 macro in hw_bitfield.h, which also gives us additional error checking. The UPDATE/HIWORD_UPDATE macros are left as wrappers around the replacement macros, in order to not rock the boat too much, and keep the changes easy to review. Signed-off-by: Nicolas Frattaroli --- drivers/media/platform/synopsys/hdmirx/snps_hdmirx.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.h b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.h index 220ab99ca61152b36b0a08b398ddefdb985709a5..b26668a98aafd1682b8342cc11f84666a13f07a3 100644 --- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.h +++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.h @@ -8,10 +8,12 @@ #ifndef DW_HDMIRX_H #define DW_HDMIRX_H +#include #include +#include -#define UPDATE(x, h, l) (((x) << (l)) & GENMASK((h), (l))) -#define HIWORD_UPDATE(v, h, l) (((v) << (l)) | (GENMASK((h), (l)) << 16)) +#define UPDATE(x, h, l) (FIELD_PREP(GENMASK((h), (l)), (x))) +#define HIWORD_UPDATE(v, h, l) (FIELD_PREP_WM16(GENMASK((h), (l)), (v))) /* SYS_GRF */ #define SYS_GRF_SOC_CON1 0x0304 -- 2.50.0 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy