Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp317343iob; Thu, 28 Apr 2022 03:10:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWUTiCOfR1LXcpNSCChFJAFpKf3tcMm4JLelu7G7MkuhK0PgNyjzJKMl2SFGhszQ3JV38j X-Received: by 2002:a17:902:bf45:b0:15c:df47:3d6 with SMTP id u5-20020a170902bf4500b0015cdf4703d6mr27406989pls.58.1651140613184; Thu, 28 Apr 2022 03:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651140613; cv=none; d=google.com; s=arc-20160816; b=ppqVADqVxmEx6B3hJfxsRFEi+zIWFWCruejHWVEkIZtMvDDQ78HN3F+lwEyNfmE8JN 9NE1F5ukBtm5IYB901YtNI80Ksqp1Vdo4kcvuXJJNPdmDIG0wuPleQo4eZi+665EogZ6 ciSVT546ZSdjHHrGKrYe3VxMmztu3Adozstk+zcD3kxwcKiV+xrk6FKK1lcrmDSrZp3B AaArO5EdmC9PSVM9F8SxdVndcw3cTIQRrevTKv+4bSNxfwZCn38eaLwdZ0tQJKvEl50R rosy+Xo5m4qHczmfActvdioLM1Pdtx5ey2cM5/ftOFznfaZi3MUyiy2BUcelZt5iUZyY /Tfw== 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=oiJlEqYi2G/M1ak/+E9q5Pf4TyGwzZSyE0d92xpEqUI=; b=gb6xTVRt+trSh8Qo3vuReEcCh6WeWsHPEcvSbN8s1jzVPZZbyI+aBanIEfe4epGVbE Cri7QK2r90SYr0JR3qayRavlvufXY5ecEE+95LX6dpOQVioaMTxvm7cDT1eKaGkAGV3z OWKnM7RA8hmYKq9Q8LmVSAeqo/JH51Bfmd1iknZ+JwWHSNSA56pjS+XZII9B7o05Vphg jx2ZzpzhABpDIWNCPM58SAqlO8UgM45gOq4s4FH7vPNwlKIWTPyJI+1FDwDhSEGaqW3f /EfxTVOonuljgT6/mr0Nml7/Y9v7/GcwVI1R/FDb7T5Nwu6rC1pBxoudJcVMMrmKMPtC pG/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=s8mV8RZ3; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 81-20020a630154000000b003aaee7fbbd0si3734102pgb.447.2022.04.28.03.09.58; Thu, 28 Apr 2022 03:10:13 -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=@quicinc.com header.s=qcdkim header.b=s8mV8RZ3; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242261AbiD1DfE (ORCPT + 99 others); Wed, 27 Apr 2022 23:35:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242237AbiD1De6 (ORCPT ); Wed, 27 Apr 2022 23:34:58 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F5197DAB4; Wed, 27 Apr 2022 20:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1651116704; x=1682652704; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oiJlEqYi2G/M1ak/+E9q5Pf4TyGwzZSyE0d92xpEqUI=; b=s8mV8RZ3RpfGabQGnroBhQiLlLOyA9flaX5D1Si5D1BokK2mKiEVCJ8i jP5Ns1Z1Ju9Dcvg7aRAWfh8cQif7iUvrI8Jpmub+qV3HJIqLYysH0xqXy Eb7elQ5YxXBlJK2YtY833a8Kw61bWyDGdRtVrnI7uBgxMBzU+HslTd32N M=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-01.qualcomm.com with ESMTP; 27 Apr 2022 20:31:44 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2022 20:31:43 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 27 Apr 2022 20:31:42 -0700 Received: from blr-ubuntu-253.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 27 Apr 2022 20:31:38 -0700 From: Sai Prakash Ranjan To: , , CC: , , , , , , , , Subject: [PATCHv11 3/6] irqchip/tegra: Fix overflow implicit truncation warnings Date: Thu, 28 Apr 2022 09:00:10 +0530 Message-ID: <18e6983d6a7f49f97c57aa1af5bd1d6622c989a7.1645772606.git.quic_saipraka@quicinc.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 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); ^ Cc: Marc Zyngier Suggested-by: Marc Zyngier Reviewed-by: Arnd Bergmann Signed-off-by: Sai Prakash Ranjan --- 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.33.1