RE: [PATCH v6 6/7] PCI: rcar-gen4: Add support for r8a779g0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Manivannan again,

> From: Yoshihiro Shimoda, Sent: Thursday, April 11, 2024 6:10 PM
> > From: Manivannan Sadhasivam, Sent: Thursday, April 11, 2024 2:52 AM
> > On Wed, Apr 10, 2024 at 09:48:31AM +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;
> > > +	writel(tmp, rcar->phy_base + offset);
> >
> > If you use FIELD_* macros, then the values can be passed sensibly ie., just 0
> > and 1.
> 
> I got it. I'll use FIELD_* macros.

When I modified the code like below, build error happened.
Is the code below your expectation?
---
        tmp = readl(rcar->phy_base + offset);
        tmp &= ~mask;
        tmp |= FIELD_PREP(mask, val);
        writel(tmp, rcar->phy_base + offset);
---
drivers/pci/controller/dwc/pcie-rcar-gen4.c: In function 'rcar_gen4_pcie_phy_reg_update_bits':
././include/linux/compiler_types.h:449:45: error: call to '__compiletime_assert_408' declared with attribute error: FIELD_PREP: mask is not constant
  449 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |
---

It seemed that we cannot use a variable in the first argument of FIELD_PREP().

Best regards,
Yoshihiro Shimoda





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux