Skip to content

Commit 4436859

Browse files
Sai Prakash Ranjanarndb
authored andcommitted
irqchip/tegra: Fix overflow implicit truncation warnings
Fix -Woverflow warnings for tegra irqchip driver which is a result of moving arm64 custom MMIO accessor macros to asm-generic function implementations giving a bonus type-checking now and uncovering these overflow warnings. drivers/irqchip/irq-tegra.c: In function ‘tegra_ictlr_suspend’: drivers/irqchip/irq-tegra.c:151:18: warning: large integer implicitly truncated to unsigned type [-Woverflow] writel_relaxed(~0ul, ictlr + ICTLR_COP_IER_CLR); ^ Suggested-by: Marc Zyngier <[email protected]> Signed-off-by: Sai Prakash Ranjan <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Cc: Marc Zyngier <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 018b741 commit 4436859

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/irqchip/irq-tegra.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ static int tegra_ictlr_suspend(void)
148148
lic->cop_iep[i] = readl_relaxed(ictlr + ICTLR_COP_IEP_CLASS);
149149

150150
/* Disable COP interrupts */
151-
writel_relaxed(~0ul, ictlr + ICTLR_COP_IER_CLR);
151+
writel_relaxed(GENMASK(31, 0), ictlr + ICTLR_COP_IER_CLR);
152152

153153
/* Disable CPU interrupts */
154-
writel_relaxed(~0ul, ictlr + ICTLR_CPU_IER_CLR);
154+
writel_relaxed(GENMASK(31, 0), ictlr + ICTLR_CPU_IER_CLR);
155155

156156
/* Enable the wakeup sources of ictlr */
157157
writel_relaxed(lic->ictlr_wake_mask[i], ictlr + ICTLR_CPU_IER_SET);
@@ -172,12 +172,12 @@ static void tegra_ictlr_resume(void)
172172

173173
writel_relaxed(lic->cpu_iep[i],
174174
ictlr + ICTLR_CPU_IEP_CLASS);
175-
writel_relaxed(~0ul, ictlr + ICTLR_CPU_IER_CLR);
175+
writel_relaxed(GENMASK(31, 0), ictlr + ICTLR_CPU_IER_CLR);
176176
writel_relaxed(lic->cpu_ier[i],
177177
ictlr + ICTLR_CPU_IER_SET);
178178
writel_relaxed(lic->cop_iep[i],
179179
ictlr + ICTLR_COP_IEP_CLASS);
180-
writel_relaxed(~0ul, ictlr + ICTLR_COP_IER_CLR);
180+
writel_relaxed(GENMASK(31, 0), ictlr + ICTLR_COP_IER_CLR);
181181
writel_relaxed(lic->cop_ier[i],
182182
ictlr + ICTLR_COP_IER_SET);
183183
}
@@ -312,7 +312,7 @@ static int __init tegra_ictlr_init(struct device_node *node,
312312
lic->base[i] = base;
313313

314314
/* Disable all interrupts */
315-
writel_relaxed(~0UL, base + ICTLR_CPU_IER_CLR);
315+
writel_relaxed(GENMASK(31, 0), base + ICTLR_CPU_IER_CLR);
316316
/* All interrupts target IRQ */
317317
writel_relaxed(0, base + ICTLR_CPU_IEP_CLASS);
318318

0 commit comments

Comments
 (0)