All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <mani@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Manivannan Sadhasivam <mani@kernel.org>,
	"lpieralisi@kernel.org" <lpieralisi@kernel.org>,
	"kw@linux.com" <kw@linux.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"krzysztof.kozlowski+dt@linaro.org"
	<krzysztof.kozlowski+dt@linaro.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"jingoohan1@gmail.com" <jingoohan1@gmail.com>,
	"marek.vasut+renesas@gmail.com" <marek.vasut+renesas@gmail.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH v8 4/5] PCI: rcar-gen4: Add support for r8a779g0
Date: Wed, 12 Jun 2024 20:29:33 +0530	[thread overview]
Message-ID: <20240612145933.GC58302@thinkpad> (raw)
In-Reply-To: <CAMuHMdXStQGDNP8c79Bc46kM7BMkbxi=2aVKnLrupWj9Ytn7Ug@mail.gmail.com>

On Tue, Jun 11, 2024 at 12:10:22PM +0200, Geert Uytterhoeven wrote:
> On Tue, Jun 11, 2024 at 11:21 AM Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > From: Manivannan Sadhasivam, Sent: Saturday, June 8, 2024 5:25 PM
> > > On Mon, May 20, 2024 at 04:42:59PM +0900, Yoshihiro Shimoda wrote:
> > > > +static void rcar_gen4_pcie_phy_reg_update_bits(struct rcar_gen4_pcie *rcar,
> > > > +                                          u32 offset, u32 mask, u32 val)
> > > > +{
> > > > +   u32 tmp;
> > > > +
> > > > +   tmp = readl(rcar->phy_base + offset);
> > > > +   tmp &= ~mask;
> > > > +   tmp |= val;
> > >
> > > Use FIELD_* macros to avoid using the shift value.
> >
> > According to the bitfield.h,
> > ---
> > * FIELD_{GET,PREP} macros take as first parameter shifted mask
> >  * from which they extract the base mask and shift amount.
> >  * Mask must be a compilation time constant.
> > ---
> > So, since the mask is a variable here, we cannot use FIELD_* macros for this function.
> 
> Indeed.
> 

I just can't keep the constant factor in mind for some reason.

> I tried introducing non-constant field_{prep,get}() helpers[1] in series
> [2], but there were some pushbacks.
> 
> Feel free to up-vote ;-)
> 

For sure! This will be very useful, thanks.

- Mani

> [1] "[PATCH 01/17] bitfield: Add non-constant field_{prep,get}() helpers"
> https://lore.kernel.org/all/3a54a6703879d10f08cf0275a2a69297ebd2b1d4.1637592133.git.geert+renesas@glider.be/
> 
> [2] "[PATCH 00/17] Non-const bitfield helper conversions"
> https://lore.kernel.org/all/cover.1637592133.git.geert+renesas@glider.be/
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> -- 
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
> 

-- 
மணிவண்ணன் சதாசிவம்

  reply	other threads:[~2024-06-12 14:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-20  7:42 [PATCH v8 0/5] PCI: rcar-gen4: Add R-Car V4H support Yoshihiro Shimoda
2024-05-20  7:42 ` [PATCH v8 1/5] PCI: dwc: Add PCIE_PORT_{FORCE,LANE_SKEW} macros Yoshihiro Shimoda
2024-05-20  7:42 ` [PATCH v8 2/5] PCI: rcar-gen4: Add rcar_gen4_pcie_drvdata Yoshihiro Shimoda
2024-06-05 17:29   ` Bjorn Helgaas
2024-05-20  7:42 ` [PATCH v8 3/5] PCI: rcar-gen4: Add .ltssm_control() for other SoC support Yoshihiro Shimoda
2024-06-05 14:09   ` Manivannan Sadhasivam
2024-06-05 17:29   ` Bjorn Helgaas
2024-06-11  9:07     ` Yoshihiro Shimoda
2024-05-20  7:42 ` [PATCH v8 4/5] PCI: rcar-gen4: Add support for r8a779g0 Yoshihiro Shimoda
2024-06-08  8:24   ` Manivannan Sadhasivam
2024-06-11  9:19     ` Yoshihiro Shimoda
2024-06-11 10:10       ` Geert Uytterhoeven
2024-06-12 14:59         ` Manivannan Sadhasivam [this message]
2024-05-20  7:43 ` [PATCH v8 5/5] misc: pci_endpoint_test: Document a policy about adding pci_device_id Yoshihiro Shimoda
2024-06-05 17:28   ` Bjorn Helgaas
2024-06-11  9:06     ` Yoshihiro Shimoda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240612145933.GC58302@thinkpad \
    --to=mani@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=jingoohan1@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kw@linux.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=marek.vasut+renesas@gmail.com \
    --cc=robh@kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.