Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp324537pxj; Tue, 18 May 2021 04:22:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwj47JEeTiqt+6yIf2US5H1/bTHlAalG3sYy7oiq3EpfCyjxQ7X3fpLz3lrSWc6GFaA8/nM X-Received: by 2002:a92:d947:: with SMTP id l7mr4087187ilq.266.1621336965590; Tue, 18 May 2021 04:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621336965; cv=none; d=google.com; s=arc-20160816; b=UhilCQJWQI35oKtmn5ELiO5ngprStD+Ps99/nRZV+jE7QHdulgevpB2vJnMJccKFpu 6hHxcH0qKxz4GeFymIt7OUu3OjUtK8T69tIby/jE1heX3sTL/EUCOPjgGJuEC0DoS7du FQpdeYpj3Uq+BQp8e4bpljJ1GyZGxjdenkbA/hdC2dXqvljYX5Hvo2cPccR3BzcDP77e jpr9usQm3VzgGblAewbi8m67Pe7B62n6TWeg6A1zE31NNHLsmZqFPhrMB3qVi8Hwrmlg +aUw4H7U6HujAt3ttE/k9gH+hikhUv3LjULL7FNrbGecKRDHhgOsAuXI2jHrZhA7AWPK P7dg== 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=xZYzuzhAi9hntLUyCr9h10ywgNRXwX5qrLuGX8EMi0XBqzLP9RIUBsrXwgBG7uh9/z 5VWZQJi4A/5Lh6Yrvm8j+R2aIaXnSyxm1VWcYIXQaDj1XHQQ5JVku7c3ZK9/OgpQPZS5 SnGhtVAksJ8ecfuDx0nOSSbxMYE+XP9qovTIzyqmvNeW2UkT6O1Kl7PXdV3XwVGAm3cr iMpM1AzqaOUOf1j4eJwVlLlUH/7bEKnMCuRZUjZS5z9JSqmPpw5ga4/wS83MB3mBp6ss z5BCMeNpvCV/Xp8mkWal++u0mM72WNyDG/yISxYIGrY4T5QKfCzTikhzzBMogi2zaFTx 0oPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=O350t9uX; 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 n11si6627739ilk.101.2021.05.18.04.22.30; Tue, 18 May 2021 04:22:45 -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=O350t9uX; 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 S243824AbhEQPS2 (ORCPT + 99 others); Mon, 17 May 2021 11:18:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:45118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240104AbhEQPHb (ORCPT ); Mon, 17 May 2021 11:07:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EFEF961C2D; Mon, 17 May 2021 14:29:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261774; bh=bXR9zrYF/jS7VUoMPXUgazrfG/zyt/AibQaEBDojonw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O350t9uXUl51LMxgwmVEP0gjRqKQ/5SewzoUS1xnqBd7UT5fzy0lVtGkVLS6M+RTP rDWY1emujVSw/OAmabu3AiMvZdPpy1eVKH/1rwGpoHebVAGcWfkqcCNf78nj+pTxzc 7l4Vwn0IYxoYA6P4fHG0I1pRu9fcdWO1xCDO/pSI= 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.10 046/289] pinctrl: samsung: use int for register masks in Exynos Date: Mon, 17 May 2021 15:59:31 +0200 Message-Id: <20210517140306.756284937@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@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