From mboxrd@z Thu Jan 1 00:00:00 1970 From: Catalin Marinas Subject: Re: [PATCH] asm-generic/pgtable-nop?d.h: define folded with a value for use in C Date: Thu, 4 Oct 2018 10:45:00 +0100 Message-ID: <20181004094500.GA108096@arrakis.emea.arm.com> References: <20181003175052.31917-1-james.morse@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20181003175052.31917-1-james.morse@arm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: James Morse Cc: linux-arch@vger.kernel.org, Mark Rutland , Will Deacon , Arnd Bergmann , linux-arm-kernel@lists.infradead.org List-Id: linux-arch.vger.kernel.org On Wed, Oct 03, 2018 at 06:50:52PM +0100, James Morse wrote: > It turns out "if (__is_defined(__PAGETABLE_PMD_FOLDED))" isn't equivalent > to "#ifdef __PAGETABLE_PMD_FOLDED". (who knew!) > > kconfig.h's __is_defined() expects a define of the form > "#define CONFIG_BOOGER 1". But these nop?d headers just have > "#define __PAGETABLE_PMD_FOLDED". I wonder why we're using __is_defined() at all on arm64. It looks like some internal kconfig.h helper for IS_ENABLED() etc. Even if it looks nicer, I'd rather go for an #ifdef in the arm64 set_pmd() code. -- Catalin From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com ([217.140.101.70]:33500 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727046AbeJDQhb (ORCPT ); Thu, 4 Oct 2018 12:37:31 -0400 Date: Thu, 4 Oct 2018 10:45:00 +0100 From: Catalin Marinas Subject: Re: [PATCH] asm-generic/pgtable-nop?d.h: define folded with a value for use in C Message-ID: <20181004094500.GA108096@arrakis.emea.arm.com> References: <20181003175052.31917-1-james.morse@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181003175052.31917-1-james.morse@arm.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: James Morse Cc: linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Arnd Bergmann , Will Deacon , Mark Rutland Message-ID: <20181004094500.IOH9_AGbVfXiwCeJdhoqbcqSNUuYYRsa_WnkfPbEFyw@z> On Wed, Oct 03, 2018 at 06:50:52PM +0100, James Morse wrote: > It turns out "if (__is_defined(__PAGETABLE_PMD_FOLDED))" isn't equivalent > to "#ifdef __PAGETABLE_PMD_FOLDED". (who knew!) > > kconfig.h's __is_defined() expects a define of the form > "#define CONFIG_BOOGER 1". But these nop?d headers just have > "#define __PAGETABLE_PMD_FOLDED". I wonder why we're using __is_defined() at all on arm64. It looks like some internal kconfig.h helper for IS_ENABLED() etc. Even if it looks nicer, I'd rather go for an #ifdef in the arm64 set_pmd() code. -- Catalin