Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp49629pxj; Mon, 17 May 2021 20:37:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFnyKrO2C7klLkHxg0Semx553bVvaPesak8tm055lVhMAPYjOHo9M0gfAOUXHfOD/3/Ksx X-Received: by 2002:a05:6402:1649:: with SMTP id s9mr4418622edx.35.1621309026577; Mon, 17 May 2021 20:37:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621309026; cv=none; d=google.com; s=arc-20160816; b=Fze0aMl4seA46Bcu1e5nFRHsX8u/lDpFhIb0ZhbPxuanEQp2+7rs3Cy31oQ81H95Uj WeLPARE/gjaTRM52VXxj0gQgmbidw92GLDs33BSu4R1bjc9zKIWYPK3oPMndnuoxC4wC ti6VxMjfjlyi6CjNgZ2micQgeE8hqiwB4ezXUg7B8HG+OGE41HQtqlldPAzr6r2Rn5DC 3Vt904jmv/WEUgA0sZzYvtCU4ATAls2WdXE/SpnxV0O7EioTO46+MIiCY7XlfrRiDR0F HQV6n8yRWAb2ZEvOyiZ6EFMqldh1UXyk1/VygpC78LU1VLj5TVQKypjyavgH39duRZh4 ChRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1rTdDRKn7J8NPXfuKAZ2wVOCzrgypQLoETb6KbwNlJs=; b=Aucw5aB3t+Z/5e0HAKrvpvzMgEfZ6f673NFSwc0nPO+vjkCS2V23HE4lC/VMIyPbvC ls2lKNqq20H5VE06ljN8SJUiPn5sbylqlEB/VIBznPFI68yLbFM01sxuuBQvgAbX+FuK hq5cZ9WtzeJMGU4ZsN71cwOs2UbiZlJYgACqCDfvyRsvKMcLijBnSFfRxQyuQyhWpHT7 OajMhb0WuHM07a/yvTovAAeL+pveoiF8hylpPpHVWhQYory+BickSwuZucJY2t8022nc P9YsI2or+A5sSvdVOthbJ+lsOEqySmWucQStUUWBbzIpamdt7N6f7NWxMY2xOWZQxdAD dGyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sgDhPMbs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si12906120edq.133.2021.05.17.20.36.40; Mon, 17 May 2021 20:37:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sgDhPMbs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238325AbhEQOkY (ORCPT + 99 others); Mon, 17 May 2021 10:40:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:33966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240828AbhEQOfS (ORCPT ); Mon, 17 May 2021 10:35:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C0B3661924; Mon, 17 May 2021 14:16:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261016; bh=bXR9zrYF/jS7VUoMPXUgazrfG/zyt/AibQaEBDojonw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sgDhPMbsusx56eGF6SZaHb12iw5vxl7RyS1rhyNruk97+eHUncnGb71rQfw3BN+85 1rUGEXysqL6loKGiI1i/pguOe/PqjLocu8eodvIA1vMUxcUotnlodSPCLQNka5B0g7 NZ16QJ6P9WuHRNmlCz4WenaoNpR9YNI9oKWoCS4A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Sylwester Nawrocki , Linus Walleij , Sasha Levin Subject: [PATCH 5.11 056/329] pinctrl: samsung: use int for register masks in Exynos Date: Mon, 17 May 2021 15:59:27 +0200 Message-Id: <20210517140303.956025207@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.043055203@linuxfoundation.org> References: <20210517140302.043055203@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Krzysztof Kozlowski [ Upstream commit fa0c10a5f3a49130dd11281aa27e7e1c8654abc7 ] 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 Reviewed-by: Sylwester Nawrocki Link: https://lore.kernel.org/r/20210408195029.69974-1-krzysztof.kozlowski@canonical.com Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/samsung/pinctrl-exynos.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index b9ea09fabf84..493079a47d05 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -55,7 +55,7 @@ static void exynos_irq_mask(struct irq_data *irqd) struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip); struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); unsigned long reg_mask = our_chip->eint_mask + bank->eint_offset; - unsigned long mask; + unsigned int mask; unsigned long flags; spin_lock_irqsave(&bank->slock, flags); @@ -83,7 +83,7 @@ static void exynos_irq_unmask(struct irq_data *irqd) struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip); struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); unsigned long reg_mask = our_chip->eint_mask + bank->eint_offset; - unsigned long mask; + unsigned int mask; unsigned long flags; /* @@ -483,7 +483,7 @@ static void exynos_irq_eint0_15(struct irq_desc *desc) chained_irq_exit(chip, desc); } -static inline void exynos_irq_demux_eint(unsigned long pend, +static inline void exynos_irq_demux_eint(unsigned int pend, struct irq_domain *domain) { unsigned int irq; @@ -500,8 +500,8 @@ static void exynos_irq_demux_eint16_31(struct irq_desc *desc) { struct irq_chip *chip = irq_desc_get_chip(desc); struct exynos_muxed_weint_data *eintd = irq_desc_get_handler_data(desc); - unsigned long pend; - unsigned long mask; + unsigned int pend; + unsigned int mask; int i; chained_irq_enter(chip, desc); -- 2.30.2