Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2966819pxj; Mon, 17 May 2021 14:21:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXX4+a8+CZjroQ2H7GCtSSaen4Gl01JB6eAx08SZeLKmhfgH44og17SYDEcx5ICpvxjx3f X-Received: by 2002:a05:6e02:1b07:: with SMTP id i7mr1444671ilv.121.1621286482488; Mon, 17 May 2021 14:21:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621286482; cv=none; d=google.com; s=arc-20160816; b=XUNVYdDdcRaRFXsetl4p76bwV6xWXvXzHFf+yoRQtkPRU9dV9U55KpBA2hxyRSriTV L94CLtXLIt7RssA36yOlLJmXuyYARWMMXBqEd8SivJhCoZRQc93pRES7W89hKGswlUgQ 0f6q7HEv+8emlbWL+KdUz/fqmA9xy8wuT6fpDEoVaI86KW3sxoNkrQqgB8T+AaL0YfVZ 1r3lTRqyjzREuHLG2wQCmdmIIjf2m4Za0H0SKOgpfmT4VzYfMDA25bydNtVzIZHbUzbe R1WCpXDkhPIWFbI1NujJTo96NARSsOBTJeYSEh3Tpg1xC4ZYqQLPc1CO/yXSMQNhesXV K7wQ== 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=EDZXFSGAQt0+4UyNza7WmGtiIyqfYytoxeewFYVuJRY=; b=vMbpReEbhnBxPGDg1KT5Gg6W87TyklTwVCwf/nWhio763qtmD+kTeIA3BtQqJABz30 bltOWKc2V6ERDEtp2aMWfCrthmVxIZatCfbWOufKvdZ8d3af5vJMxEug65aQOpljSUEE rnyjdS/JQe+XPYvpFHKIt4eKLPCdoksBzyOpFk3Ep356u9xr7a9olAphM+KSv7FzJfA2 tPshh9hOx+lVy5lpFJsmWmN9qEKwClDchGSuDn4jwh9mFdZg7o3tkEESE+azInxyX84B N2VAvcemPqp9ttoHt/xrE4iZPwcDHZLYCUBZrevJdNQujH8wXGjP6wZ37pmvH8pZgfLJ /Kwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Hv0rbfPh; 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 y10si22170155ill.98.2021.05.17.14.21.08; Mon, 17 May 2021 14:21:22 -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=Hv0rbfPh; 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 S238512AbhEQOLC (ORCPT + 99 others); Mon, 17 May 2021 10:11:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:60562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238130AbhEQOIT (ORCPT ); Mon, 17 May 2021 10:08:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CDC6760724; Mon, 17 May 2021 14:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260396; bh=B+EMqvSUBUldqZ6ClL7veoudJmVUUSPY1yhJymXxLwk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hv0rbfPhlHAXI2XZs3WQv/tlCpElvf2TCfAtUIcXVwH3K5zJZ9rlD9EeHTwY0GBKN Aj2Rd8u1kC02MO1kGFN3IT3dYSiXH4K79q7uu7FQ/IQngzhCswEJRnbqFqeap+1xqw trGAbzpfCT9QQa2TryvR2FzgZKBm+OVo3scqN/t0= 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.12 061/363] pinctrl: samsung: use int for register masks in Exynos Date: Mon, 17 May 2021 15:58:47 +0200 Message-Id: <20210517140304.673334066@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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 0cd7f33cdf25..2b99f4130e1e 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; raw_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