Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3520755rwo; Fri, 4 Aug 2023 06:15:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYve4MVbqtqhMWyqLykyzGpbHNd6r1q9lrKUuhVxSAtLG3b7y1p4EVC4cUC1N0XdLBDx6M X-Received: by 2002:a17:906:32c6:b0:994:4e9c:30c6 with SMTP id k6-20020a17090632c600b009944e9c30c6mr1501914ejk.57.1691154955028; Fri, 04 Aug 2023 06:15:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691154955; cv=none; d=google.com; s=arc-20160816; b=XUqo6gkHnzuksBwTTkYOmGVKnqtojS4y/4yf8KJpDQBPWT0ZplHs71I1qqy1b+TSBN 717D/vtD96a+o3q4KOWA2clysKOcN6phzMnmLzM/u41C+djK9CdfaUhOq54v3PqpvSQs suXGd/4UkXTsjc6tbPTvF08oH231z8EqNA76/D6s0uQ40yPrKxwAr/8fXTIhMmjmGDJg UaA6TqQUrKkdUFwDSQJZzm97MYWcxQhxGyHq2wO8P2jz0jRz4rLkiDaKHfgF2fa54dH4 Z6T3qyaEF5sGK0ua9SPU2NFeHttUc1nJoWaPQ91ck5qssZHu+b64Bs0CH1C1XDm6Irbx iuVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=PXToQMCoevt6X3IVnwSO50JnRPRxORSUKskwOr6vzkM=; fh=wJeUeR9OQu+gQ09+y4rfnBlOiApw9Q/43TwS08zMEvc=; b=0qjXjf3h/x8lkydiUEdRPLRsOGLJi7lXDZTq2Tn+ePfQotat8l5xPqD2We1KQIY8TV L/bn5gPVdFHJnXO0I2JHdaJeFRalR75HpnLxajwgaLfSVn6aBFFWNyL3eUoTKCY7bjj3 r8uv7BNcMLh4GV/SWHKzkw5zaCnu0S/HJMyZGZu3TsufzygQ32L8FPfq+qTBYXTdYekX xE8kjQqoy8xQEpiCZI4uxXRPpTrBMb3QqGUuOovAgNb+CUUl+zGMmI7Mg5GZpz6OVrwU omBwZM8cBMrgOqrGi8uAR1hX470xu8tiIxIHOK/XuiU8qSvFV7mmC0U1mGKhNEbP0l1Z RXOA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q9-20020a1709064c8900b0099b46fc04f6si1708587eju.1006.2023.08.04.06.15.29; Fri, 04 Aug 2023 06:15:55 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229581AbjHDMtB (ORCPT + 99 others); Fri, 4 Aug 2023 08:49:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbjHDMtA (ORCPT ); Fri, 4 Aug 2023 08:49:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E0B24C18 for ; Fri, 4 Aug 2023 05:48:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E87B361FD4 for ; Fri, 4 Aug 2023 12:48:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21B5DC433C7; Fri, 4 Aug 2023 12:48:21 +0000 (UTC) Date: Fri, 4 Aug 2023 13:48:19 +0100 From: Catalin Marinas To: Zhang Jianhua Cc: will@kernel.org, ardb@kernel.org, mark.rutland@arm.com, ryan.roberts@arm.com, anshuman.khandual@arm.com, joey.gouly@arm.com, thunder.leizhen@huawei.com, bhe@redhat.com, kristina.martsenko@arm.com, yajun.deng@linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next v4] arm64: fix build warning for ARM64_MEMSTART_SHIFT Message-ID: References: <20230804075615.3334756-1-chris.zjh@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230804075615.3334756-1-chris.zjh@huawei.com> X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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 On Fri, Aug 04, 2023 at 03:56:15PM +0800, Zhang Jianhua wrote: > When building with W=1, the following warning occurs. > > arch/arm64/include/asm/kernel-pgtable.h:129:41: error: "PUD_SHIFT" is not defined, evaluates to 0 [-Werror=undef] > 129 | #define ARM64_MEMSTART_SHIFT PUD_SHIFT > | ^~~~~~~~~ > arch/arm64/include/asm/kernel-pgtable.h:142:5: note: in expansion of macro ‘ARM64_MEMSTART_SHIFT’ > 142 | #if ARM64_MEMSTART_SHIFT < SECTION_SIZE_BITS > | ^~~~~~~~~~~~~~~~~~~~ > > The generic PUD_SHIFT was defined in include/asm-generic/pgtable-nopud.h, > however the #ifndef __ASSEMBLY__ guard in this header file makes it unavailable > for assembly files. While someone .S file include the , > the build warning would occur. Now move the macro ARM64_MEMSTART_SHIFT and > ARM64_MEMSTART_ALIGN to arch/arm64/mm/init.c where it is used only, to avoid > this issue. > > Signed-off-by: Zhang Jianhua Reviewed-by: Catalin Marinas