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 7B287CA0FF0 for ; Tue, 26 Aug 2025 20:45:14 +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:From:References:Cc:To: Subject: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=48BwA4VG7sSTK5nCGrZby15ueYyhKwabYbYiTUYoxd8=; b=w2ORgpLhp10Mnh LKxutWxwPSSGRctCBWFJAHstNo58LyLDYJhXFXDiAgpsh3NKE06dcRGKViDcqp6PYUkBuhEI1F1bj JiM4C8ImnelLlBcQPJjfkJxH/Yjkp+oa5gwF/YwMuNAqPlfdaFhY6x3A3O4YhuDkWQB5RO1VUba9v vd4X1SSXbBIZ0UMTnI3Xsdz29yOcWqYsRkzDMNysWpRxck54TZstsJxJz2Lzy12GiI1NWMD2AVrgY 67Q66X+UGyizvhDg3bH5cdtqc5cj0wdQp9OYgo+cTuH1RxJWuovxdhH9VnzpnoznttXTvpqIkNZJ9 kdchQw+J0W0WQN47m8QA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1ur0Xa-0000000D83m-0Iyv; Tue, 26 Aug 2025 20:45:14 +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 1ur0XX-0000000D834-41tX; Tue, 26 Aug 2025 20:45:13 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1756241053; cv=none; d=zohomail.com; s=zohoarc; b=j2yVxPbvVmnkEx3m/dN6e1AnUw4nYDLYLrQh9jouqxO5BJjiiCr793G8HSPBwBdIjatD9NagViFauNjRfSXiN5OkOvRkuqJsv3BkMAKRRezf9KhkZ9qHONfzjNiYdn92suhyL8w0t2CahFZ6j03Kzk/PHMsJrm8p8efMx+NlI/M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756241053; 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=h44Qfi5J3Y304gTJmb6TLXLe4gIhtF4d/gBhlL0gNV4=; b=N2xtWkuh45RuU2Vs8YqwfZJBv6pw4MgqWCT3y3wTsVdIc4i07F27CpHJTe6r0RHrYKECjA2mdKudHQ73mnL9z6hLRcvSqq2844PABhn+1mHxPbT5bMHwssg/rwWgr6mQ/zKgi0MKUL5PN5Wc1C2feJz+9yYB4bE83Epayd99uKE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=dmitry.osipenko@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1756241053; s=zohomail; d=collabora.com; i=dmitry.osipenko@collabora.com; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=h44Qfi5J3Y304gTJmb6TLXLe4gIhtF4d/gBhlL0gNV4=; b=Ki9wPHONx+Kgfg+EjzLJhd6LwqGwWdyDua6+Z+EDmJEbzyVUdyErOswt5JJ7uGnV yBZm/csgF+b9XzuM3ZCk9g4oG2mnCIHV2SY/tvJsxQ81i+wvrbET0R14VjHnkb41YXS mDPO7PRK+qiv+NHwXJGh2VBPtPHhrJ7sOczkb5CI= Received: by mx.zohomail.com with SMTPS id 1756241051276539.1866484786493; Tue, 26 Aug 2025 13:44:11 -0700 (PDT) Message-ID: <676d88d1-c15a-4648-a4c5-c668e40b12f0@collabora.com> Date: Tue, 26 Aug 2025 23:43:57 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird 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> From: Dmitry Osipenko Content-Language: en-US In-Reply-To: <20250825-byeword-update-v3-4-947b841cdb29@collabora.com> X-ZohoMailClient: External X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250826_134512_058236_0765F162 X-CRM114-Status: GOOD ( 17.88 ) 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 8/25/25 11: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 > --- > 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))) Nit: the extra parens around FIELD_PREP may be omitted Acked-by: Dmitry Osipenko -- Best regards, Dmitry -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy