Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1681282rwb; Sun, 14 Aug 2022 09:23:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Xg39dfO44xvhuvfqSKy60T3Jn856/yWQoctwRFf7/83umXXX13r7E6cE5j/PCQIG/vu1+ X-Received: by 2002:a17:90a:df96:b0:1f3:22e:7826 with SMTP id p22-20020a17090adf9600b001f3022e7826mr13780657pjv.21.1660494238405; Sun, 14 Aug 2022 09:23:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660494238; cv=none; d=google.com; s=arc-20160816; b=ij6UxXUqZ+L2pECNCjtkVkx2JaPWPJhWK6y5Azn+OV6oJMYYjg3GqTxqcjKb6inPyH L38SLzLiCLe7IvWb4dmQnY9ioe9ThoLKsN0rvI9IqgUNp0PhwILgL/54LuC5NHf89kEc 9a7o+NI7dDXKVrPpCYbl37/rq1lWrrPAcS9cQefrI6Z+PKM83miAs99WYFsJYbmuSEil Tu+BxUJ8fT6QcVNn+NZCpyWPhz+pPfSAcwzzziBohCN9QTqVFfkoeGFZ/MPjhEa+CrgX 5EXYnV1AFCeISqHEQilVjl6o+nHKeoq/y7FFp3hSaHj3W3aXnmhuj4aQ01YJiDhZsJmx rCbg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Mt2htISRwg57eEclu52zuWZkRqt5atJhLGp8pNJ2UIY=; b=VTJV/qjuN1N8523Vzr8hSY2Ok6/Ir3+FGHSEi6SXckVCRAfQlBm4KFLWLXnB8ILzyM dQHr7//irkpPj4jxvN9dMMTWJUp7UWhJjNwcLMeiO6/Np7kIVze3CgAsOQLzWNTgeO/t FGkWYU8jgvh0TZ7tgMgCOy9xvzNgnQBLf764y/sSmb74EByqWZlVldYQHXLdV7ZHeu4d BLTkdogU0OAxIKvrAjoUCdpDwtFTn9zb2yGnMrMNpxo8RoFahydSJSh5zz+oTnXnzp0L XEJK28erXsZZGOnAq7/dw3kpEPnweNlpT5f9oK4QIW6iliKA6YZkjp9cv9e7brLpsK0f ZIeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PupUPVoh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pi14-20020a17090b1e4e00b001f505550ef9si9057289pjb.113.2022.08.14.09.23.47; Sun, 14 Aug 2022 09:23:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PupUPVoh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239662AbiHNP25 (ORCPT + 99 others); Sun, 14 Aug 2022 11:28:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240149AbiHNP23 (ORCPT ); Sun, 14 Aug 2022 11:28:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2DD5AE62; Sun, 14 Aug 2022 08:28:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CBA3BB80B27; Sun, 14 Aug 2022 15:28:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8983AC433B5; Sun, 14 Aug 2022 15:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660490902; bh=hRPBfczdm15C8/gZO/F3YClMCpGorCXgOhAyyTX1B+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PupUPVohimlC8EMKPfaXVMVfknhoBR1YLSTaEIqmVhvbeOcs5coPuW9JBPopgvsaZ edDEz84enHgXDffxL/1M5uSTI0uIyPtEAXAFJTAsm2xC00Wqx2NnPNAnPVkK5lX8oP Hv8PvV6+qnFsZp1qASrEFL062+2ruDaa3IMVR/0yA1qkRD+3TFsfYY1cbiabUc+6Wq 2V9W7RoivPgLBimCkO0pfwgzqJ5hIf9nxoYTI3VKz9D9UaBAswYyMXYOEWoK9TnSAl c9Kb0dvnW5+Qq93pKjKreDv2GqjCrSmKmzMxvDWL+IqImQsbuH1gzUcQRZs3Nc4seQ 3MuhXD2O3xtMw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sai Prakash Ranjan , Marc Zyngier , Arnd Bergmann , Sasha Levin , tglx@linutronix.de, thierry.reding@gmail.com, jonathanh@nvidia.com, linux-tegra@vger.kernel.org Subject: [PATCH AUTOSEL 5.19 15/64] irqchip/tegra: Fix overflow implicit truncation warnings Date: Sun, 14 Aug 2022 11:23:48 -0400 Message-Id: <20220814152437.2374207-15-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220814152437.2374207-1-sashal@kernel.org> References: <20220814152437.2374207-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sai Prakash Ranjan [ Upstream commit 443685992bda9bb4f8b17fc02c9f6c60e62b1461 ] Fix -Woverflow warnings for tegra irqchip driver which is a result of moving arm64 custom MMIO accessor macros to asm-generic function implementations giving a bonus type-checking now and uncovering these overflow warnings. drivers/irqchip/irq-tegra.c: In function ‘tegra_ictlr_suspend’: drivers/irqchip/irq-tegra.c:151:18: warning: large integer implicitly truncated to unsigned type [-Woverflow] writel_relaxed(~0ul, ictlr + ICTLR_COP_IER_CLR); ^ Suggested-by: Marc Zyngier Signed-off-by: Sai Prakash Ranjan Reviewed-by: Arnd Bergmann Cc: Marc Zyngier Signed-off-by: Arnd Bergmann Signed-off-by: Sasha Levin --- drivers/irqchip/irq-tegra.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/irqchip/irq-tegra.c b/drivers/irqchip/irq-tegra.c index e1f771c72fc4..ad3e2c1b3c87 100644 --- a/drivers/irqchip/irq-tegra.c +++ b/drivers/irqchip/irq-tegra.c @@ -148,10 +148,10 @@ static int tegra_ictlr_suspend(void) lic->cop_iep[i] = readl_relaxed(ictlr + ICTLR_COP_IEP_CLASS); /* Disable COP interrupts */ - writel_relaxed(~0ul, ictlr + ICTLR_COP_IER_CLR); + writel_relaxed(GENMASK(31, 0), ictlr + ICTLR_COP_IER_CLR); /* Disable CPU interrupts */ - writel_relaxed(~0ul, ictlr + ICTLR_CPU_IER_CLR); + writel_relaxed(GENMASK(31, 0), ictlr + ICTLR_CPU_IER_CLR); /* Enable the wakeup sources of ictlr */ writel_relaxed(lic->ictlr_wake_mask[i], ictlr + ICTLR_CPU_IER_SET); @@ -172,12 +172,12 @@ static void tegra_ictlr_resume(void) writel_relaxed(lic->cpu_iep[i], ictlr + ICTLR_CPU_IEP_CLASS); - writel_relaxed(~0ul, ictlr + ICTLR_CPU_IER_CLR); + writel_relaxed(GENMASK(31, 0), ictlr + ICTLR_CPU_IER_CLR); writel_relaxed(lic->cpu_ier[i], ictlr + ICTLR_CPU_IER_SET); writel_relaxed(lic->cop_iep[i], ictlr + ICTLR_COP_IEP_CLASS); - writel_relaxed(~0ul, ictlr + ICTLR_COP_IER_CLR); + writel_relaxed(GENMASK(31, 0), ictlr + ICTLR_COP_IER_CLR); writel_relaxed(lic->cop_ier[i], ictlr + ICTLR_COP_IER_SET); } @@ -312,7 +312,7 @@ static int __init tegra_ictlr_init(struct device_node *node, lic->base[i] = base; /* Disable all interrupts */ - writel_relaxed(~0UL, base + ICTLR_CPU_IER_CLR); + writel_relaxed(GENMASK(31, 0), base + ICTLR_CPU_IER_CLR); /* All interrupts target IRQ */ writel_relaxed(0, base + ICTLR_CPU_IEP_CLASS); -- 2.35.1