Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp32855pxj; Thu, 20 May 2021 03:57:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtK/Z9vKQh1AbCXdnlX7UUE95WiObzCM6Arlkk0Iw6z5WM0phYYFlvtsY9dDq+w6Kud/li X-Received: by 2002:a17:906:3ce9:: with SMTP id d9mr4064052ejh.172.1621508270942; Thu, 20 May 2021 03:57:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621508270; cv=none; d=google.com; s=arc-20160816; b=KHapumvkBcVHZJTzzZA0p/SPH/hn29jxFwFnlz7oSLgWXZIYil7Ra8dvPwVW1vm3Jk mh6bXpgzXT0ZUTCxoYblaxfRP26OavkIlU3h7tabsuWuox76XNG2o9MCSav6KhW7eDmp bGPH04hUoBdKnMZ1hdCMRWPzyNQLTGPMe+RLFm4TAc5cM2FuezyedI6XlxbrTsQc7kd8 hd/J3rrh6XcheLgOwiSfjxvA6uOlaPIu8EucyUFLeL2om+ZTRckZJTCycACpqvOXVTky g6skjlYrkBqs3eq0FyENFqlPH6irlf4I7fQSH33kHYzT51oEdLWt2HJD1C9fClvcm3bI 4QZg== 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=OZ/VoEV/bYK9cog1HpKgU2K1U/bqNbEexAngVmXQPhw=; b=vq1XDNMyo7a2XpmeysnnAtXFxRmr3J8B6d+m7Wcb6mctr+vzTSugnR6RWvEUM30kcx mFLYKoXLR5tRgEZjlNLF3mbCx8W2ucSfplbhcNOmlRel3mAUCLfgXtn4k7fVeQKA43fl ps2V9ndywSnnrfqSickuzvM79ZGwPy4/QqokQJ0pyamn/AHHndM3DB0pus7zqksPXLPU lrQkAkNjenEzJ2IW6++s/yYaqc4zIXT41sVd8b1me4a4fkpZ+U42lwE7dyw8MWgwLfXF J0EmRnjPG7IVeQHS5G0+FIv5JGF5y1lBxl4gm56s6+IIADqKIdFEpDuAtGPkVekEUaG1 KFvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xD4X3ELC; 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 bz26si2322972ejc.256.2021.05.20.03.57.26; Thu, 20 May 2021 03:57:50 -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=xD4X3ELC; 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 S239419AbhETKy5 (ORCPT + 99 others); Thu, 20 May 2021 06:54:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:39796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238159AbhETKjd (ORCPT ); Thu, 20 May 2021 06:39:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1AD4961C6A; Thu, 20 May 2021 09:55:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504512; bh=6Y5i4m5xCXTHXcjcTm1/tQMuYDcrC7o+ggBgjbU9qFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xD4X3ELCCATL56KPQVgn5T6bter5az8To1XwiT6Q2Xf/OVk28Oi8i7st0hT1bPHBW RWT70iLVHsdvrDFA4TwplEov25WE+/HDJBEJ8sF+8CtL6TgjtIGvE6t/Qz84yAD2BT HVYDkMW/7ySwpaMlFf+lBodT7nsOrdEk5t8hDulY= 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 4.14 245/323] pinctrl: samsung: use int for register masks in Exynos Date: Thu, 20 May 2021 11:22:17 +0200 Message-Id: <20210520092128.593656330@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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 6925a3d969e2..13d6a50ca96c 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; /* @@ -409,7 +409,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; @@ -426,8 +426,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