From patchwork Wed Oct 3 17:50:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10625137 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA388112B for ; Wed, 3 Oct 2018 17:52:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4D4028F43 for ; Wed, 3 Oct 2018 17:52:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A65DC28DB9; Wed, 3 Oct 2018 17:52:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4698B28DB9 for ; Wed, 3 Oct 2018 17:52:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=Zp52vEgW5np7cAJXZ3izKKYv0gy36tNXKbcOO/EMCP8=; b=uUOhRJjrzQj3+B XRX0pKFKUSXOgLdhRNi6RAl+2NmqnjrfbtEXsfqagumxC73MU3cbpxaWp5wq3NiiCRPEz4OIA7bGZ qFktGcJCIksSkZ+5oO/L6v9PgElwSjK4s1gdG/utAniYMAPsXrj88+GsVvq5pBXLGV6llmwAkzq67 ew9KcqW2BcAPJZRSixgThHPmiVhHl5uyBqp3FtbuaQ90eAg8xxew8GbnnJee0hQyoZYE2pf3tnIzl LEmzD+8hXwrryFzmUxO65f1csrPS41qXvKSMytkapMZemstD+vSM9nMiXaicFKZp+69oPLE5ZBlA9 1K9fqJVqq6Wor66b6+wg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g7lJd-0000R5-Qv; Wed, 03 Oct 2018 17:52:05 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g7lIt-0008Si-B9 for linux-arm-kernel@lists.infradead.org; Wed, 03 Oct 2018 17:51:27 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E9EDB80D; Wed, 3 Oct 2018 10:51:08 -0700 (PDT) Received: from melchizedek.Emea.Arm.com (melchizedek.emea.arm.com [10.4.12.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7F2CA3F5B3; Wed, 3 Oct 2018 10:51:07 -0700 (PDT) From: James Morse To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] asm-generic/pgtable-nop?d.h: define folded with a value for use in C Date: Wed, 3 Oct 2018 18:50:52 +0100 Message-Id: <20181003175052.31917-1-james.morse@arm.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181003_105119_455349_3F8694D2 X-CRM114-Status: GOOD ( 12.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Mark Rutland , Arnd Bergmann , Catalin Marinas , Will Deacon , James Morse Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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". This means ____is_defined()'s triplet passed to __take_second_arg() is 'empty-string, 1 0' in both cases, meaning these symbols can't be used from C. (they are always false). asm-generic gets away with this as its using the pre-processor's defined() macro on this, not the C __is_defined(). Add the expected '1'. Signed-off-by: James Morse CC: Mark Rutland --- This fixes an issue with patches queued for arm64. Can it go via the arm64 tree? Link: lore.kernel.org/r/0f9a3abc-4890-faf5-ee7e-18434641b858@arm.com include/asm-generic/pgtable-nopmd.h | 2 +- include/asm-generic/pgtable-nopud.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h index f35f6e8149e4..fcb4769a075a 100644 --- a/include/asm-generic/pgtable-nopmd.h +++ b/include/asm-generic/pgtable-nopmd.h @@ -8,7 +8,7 @@ struct mm_struct; -#define __PAGETABLE_PMD_FOLDED +#define __PAGETABLE_PMD_FOLDED 1 /* * Having the pmd type consist of a pud gets the size right, and allows diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h index e950b9c50f34..d300dbcddaf3 100644 --- a/include/asm-generic/pgtable-nopud.h +++ b/include/asm-generic/pgtable-nopud.h @@ -9,7 +9,7 @@ #else #include -#define __PAGETABLE_PUD_FOLDED +#define __PAGETABLE_PUD_FOLDED 1 /* * Having the pud type consist of a p4d gets the size right, and allows