On Tue, Oct 22, 2019 at 06:18:57PM +0800, Dilip Kota wrote:(Sorry for the late reply, I am back today from sick leave.)
On 10/21/2019 6:44 PM, Dilip Kota wrote:First of all, it's a good behaviour to avoid way long quoting.
On 10/21/2019 4:29 PM, Gustavo Pimentel wrote:
On Mon, Oct 21, 2019 at 7:39:19, Dilip Kota
<eswara.kota@xxxxxxxxxxxxxxx>
wrote:
If you look at bitfield.h carefully you may find in particularI tried using FIELD_PREP and FIELD_GET but it is failing because FIELD_PREPSure, i will update it.+static void pcie_update_bits(void __iomem *base, u32 mask, u32I'd suggest to the a take on FIELD_PREP() and FIELD_GET() and use more
val, u32 ofs)
+{
+ÂÂÂ u32 orig, tmp;
+
+ÂÂÂ orig = readl(base + ofs);
+
+ÂÂÂ tmp = (orig & ~mask) | (val & mask);
+
+ÂÂÂ if (tmp != orig)
+ÂÂÂÂÂÂÂ writel(tmp, base + ofs);
+}
intuitive names such as new and old, instead of orig and tmp.
and FIELD_GET
are expecting mask should be constant macro. u32 or u32 const are not
accepted.
u32_replace_bits().