Skip to content

Commit 28c2a1d

Browse files
krzkgregkh
authored andcommitted
pinctrl: samsung: use 'int' for register masks in Exynos
[ Upstream commit fa0c10a ] The Special Function Registers on all Exynos SoC, including ARM64, are 32-bit wide, so entire driver uses matching functions like readl() or writel(). On 64-bit ARM using unsigned long for register masks: 1. makes little sense as immediately after bitwise operation it will be cast to 32-bit value when calling writel(), 2. is actually error-prone because it might promote other operands to 64-bit. Addresses-Coverity: Unintentional integer overflow Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Link: https://lore.kernel.org/r/20210408195029.69974-1-krzysztof.kozlowski@canonical.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 2eac474 commit 28c2a1d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎drivers/pinctrl/samsung/pinctrl-exynos.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static void exynos_irq_mask(struct irq_data *irqd)
5555
struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip);
5656
struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
5757
unsigned long reg_mask = our_chip->eint_mask + bank->eint_offset;
58-
unsigned long mask;
58+
unsigned int mask;
5959
unsigned long flags;
6060

6161
spin_lock_irqsave(&bank->slock, flags);
@@ -83,7 +83,7 @@ static void exynos_irq_unmask(struct irq_data *irqd)
8383
struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip);
8484
struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
8585
unsigned long reg_mask = our_chip->eint_mask + bank->eint_offset;
86-
unsigned long mask;
86+
unsigned int mask;
8787
unsigned long flags;
8888

8989
/*
@@ -483,7 +483,7 @@ static void exynos_irq_eint0_15(struct irq_desc *desc)
483483
chained_irq_exit(chip, desc);
484484
}
485485

486-
static inline void exynos_irq_demux_eint(unsigned long pend,
486+
static inline void exynos_irq_demux_eint(unsigned int pend,
487487
struct irq_domain *domain)
488488
{
489489
unsigned int irq;
@@ -500,8 +500,8 @@ static void exynos_irq_demux_eint16_31(struct irq_desc *desc)
500500
{
501501
struct irq_chip *chip = irq_desc_get_chip(desc);
502502
struct exynos_muxed_weint_data *eintd = irq_desc_get_handler_data(desc);
503-
unsigned long pend;
504-
unsigned long mask;
503+
unsigned int pend;
504+
unsigned int mask;
505505
int i;
506506

507507
chained_irq_enter(chip, desc);

0 commit comments

Comments
 (0)