From patchwork Thu Mar 21 01:35:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yipeng Zou X-Patchwork-Id: 13598297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 99BEDC54E67 for ; Thu, 21 Mar 2024 01:36:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=m+kUUSqvQzg9tQz2o2JPwmQ/dgB+GRfnzexwVV8a2iM=; b=B86BjjRXPkwUW2 YH2TfO3rsV8WgyhtY6cU/OUrd4+kZhUShjjHAt0jFocCcxikgLWYsnG58WOm222ROBqY3TglDn7AX I9xj64GTw6Ry3/FfE0vaczAy3rLCeZvG4Q5ZyXzV7eLF8bnwj+abDxWHPpmdI8s3HIo0UtnYdRgNV atuDDwguVUZme7vFoV3PMgWu2FJ4EGZ+7MlF4BBbKLXZVDQHixTR/6CRU0FYT8AKiPDj1YPElmQpw Esg8TBBa+Ea/o+rjf59QgbMQy7ir1kzclVeb4X0GSaMQ+fWXOm61YCd53jnCL8BhuT3ymkIwNcLTH Rw9SvSSctt1PxKCXn1kw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rn7M1-00000001S5u-1e3U; Thu, 21 Mar 2024 01:36:25 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rn7Lx-00000001S3E-1OGJ for linux-arm-kernel@lists.infradead.org; Thu, 21 Mar 2024 01:36:23 +0000 Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4V0Sdz2c4Bz1h3Dl; Thu, 21 Mar 2024 09:33:27 +0800 (CST) Received: from canpemm500008.china.huawei.com (unknown [7.192.105.151]) by mail.maildlp.com (Postfix) with ESMTPS id 252C91A0172; Thu, 21 Mar 2024 09:36:01 +0800 (CST) Received: from huawei.com (10.90.53.73) by canpemm500008.china.huawei.com (7.192.105.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 21 Mar 2024 09:36:00 +0800 From: Yipeng Zou To: , , , , , , , CC: Subject: [PATCH v2] arm: fix clang build warning in include/asm/memory.h Date: Thu, 21 Mar 2024 09:35:29 +0800 Message-ID: <20240321013529.962023-1-zouyipeng@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500008.china.huawei.com (7.192.105.151) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240320_183621_571449_FA1F2890 X-CRM114-Status: UNSURE ( 8.06 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There is a build error has been founded with build in clang-15.0.4: ./arch/arm/include/asm/memory.h:358:12: error: result of comparison "phys addr_t’ (aka 'unsigned int’) > 4294967295 is always false [-Werror, -Wtautological-type-limit-compare] if (addr > (u32)~0) ~~~~ ^ ~~~~~~~ It will be always goes fail without CONFIG_PHYS_ADDR_T_64BIT. Directly silence it by Use CONFIG_PHYS_ADDR_T_64BIT. Fixes: 981b6714dbd2 ("ARM: provide improved virt_to_idmap() functionality") Signed-off-by: Yipeng Zou Reviewed-by: Nathan Chancellor --- V2: IDMAP_INVALID_ADDR was used in other place, keep it defined. arch/arm/include/asm/memory.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index ef2aa79ece5a..07c7e759d04c 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -353,8 +353,10 @@ static inline unsigned long phys_to_idmap(phys_addr_t addr) { if (IS_ENABLED(CONFIG_MMU) && arch_phys_to_idmap_offset) { addr += arch_phys_to_idmap_offset; +#ifdef CONFIG_PHYS_ADDR_T_64BIT if (addr > (u32)~0) addr = IDMAP_INVALID_ADDR; +#endif } return addr; }