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 9410DCAC5BB for ; Wed, 1 Oct 2025 09:38:59 +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:In-Reply-To:References:Cc:To:Subject: From:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2QRfqNmQRyQpadiS0sT1TzwzmHgPgquvH+Jq2sOgI20=; b=PLej2vdEtLRHKS PhFVI51T7/JHhlAd9iKmdr3IeOV9WsGgS7wNhNkNaXXfvXt8HcED4NS90+fnjvStWMD1UR5KqYqmB KqMTw68TOwdd8rGZEErsWgYpnpjb/DdusMK1R2baj5gkJhq9Yc0MRgxK9fZDbyzxLIuROQFAxrqC1 x8N/D3oGfHz7XESnUOyJpW+qxJhncES1OJ7RcvDtQUueIeMh7vUpSOvuyQJ8dXGbJGC7lgNfWSXv7 C1XGAFj3MxSE9gPIu+qbehzTsxmiS7Yt4jpgnSUugflcBrivMI5QiV0dChbL+VXPLE/OWwH+RiKsi AJPIUiz/EPr/nS9SHOWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v3tIZ-00000007AdY-0jEp; Wed, 01 Oct 2025 09:38:59 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v3tIX-00000007Acz-33iz; Wed, 01 Oct 2025 09:38:57 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 0171461364; Wed, 1 Oct 2025 09:38:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B3EDC4CEF4; Wed, 1 Oct 2025 09:38:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1759311536; bh=H6syAT5lGzrU3swJYL8VgnwKi0EYbeSgtN9L4OFu5Z8=; h=Date:From:Subject:To:Cc:References:In-Reply-To:From; b=fcqErpp7qrjU9McG/p/HpxRq8Hc/eEK9ROwv483siLY2lhXUhIJ4c10tRVmSipFCy H1cUoUwY6REYQYV8WZwfdmDRlOhGGnduKJbFWz93kohU/Guq8JtYyLLoPuRM9+k2Hv GQvQyN+JNnqYbtW7JVcEer1SJyOhrb3ztKSs1aeFSwZHA8vy7a8Obil+4o19c8sqTi LPaIAjUoYTPSJX1vmEMzX+6OQPM0sPKz6KzJsQMYGs4GR0oonRwRzzlehm64B6DYX3 FSXty0SlySmG4Um4P4euAUBoFTJ3AHrhBhxWcvfu7azQZtRldOU8fu+H9v3hTxPnN4 UPsnsd24Vl83w== Message-ID: <50676923-1daf-4c15-a289-a791242664f4@kernel.org> Date: Wed, 1 Oct 2025 11:38:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Hans Verkuil Subject: Re: [PATCH v3 04/20] media: synopsys: hdmirx: replace macros with bitfield variants To: Nicolas Frattaroli , 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 References: <20250825-byeword-update-v3-0-947b841cdb29@collabora.com> <20250825-byeword-update-v3-4-947b841cdb29@collabora.com> Content-Language: en-US, nl In-Reply-To: <20250825-byeword-update-v3-4-947b841cdb29@collabora.com> 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 On 25/08/2025 10:28, Nicolas Frattaroli wrote: > 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 Acked-by: Hans Verkuil > --- > 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 > -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy