From patchwork Mon Dec 18 17:39:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 10121185 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 66CE260390 for ; Mon, 18 Dec 2017 17:40:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57301201B1 for ; Mon, 18 Dec 2017 17:40:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C18628684; Mon, 18 Dec 2017 17:40:51 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3E1E201B1 for ; Mon, 18 Dec 2017 17:40:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934731AbdLRRks (ORCPT ); Mon, 18 Dec 2017 12:40:48 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54216 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934770AbdLRRji (ORCPT ); Mon, 18 Dec 2017 12:39:38 -0500 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 7EF861610; Mon, 18 Dec 2017 09:39:38 -0800 (PST) Received: from approximate.cambridge.arm.com (approximate.cambridge.arm.com [10.1.207.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B2AD83F557; Mon, 18 Dec 2017 09:39:36 -0800 (PST) From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Cc: Christoffer Dall , Mark Rutland , Catalin Marinas , Will Deacon , James Morse , Steve Capper , Peter Maydell Subject: [PATCH v3 03/19] arm64: asm-offsets: Remove potential circular dependency Date: Mon, 18 Dec 2017 17:39:10 +0000 Message-Id: <20171218173926.16911-4-marc.zyngier@arm.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171218173926.16911-1-marc.zyngier@arm.com> References: <20171218173926.16911-1-marc.zyngier@arm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP So far, we've been lucky enough that none of the include files that asm-offsets.c requires include asm-offsets.h. This is about to change, and would introduce a nasty circular dependency... Let's now guard the inclusion of asm-offsets.h so that it never gets pulled from asm-offsets.c. The same issue exists between bounce.c and include/generated/bounds.h, and is worked around by using the existing guard symbol. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/asm-offsets.h | 2 ++ arch/arm64/kernel/asm-offsets.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/arm64/include/asm/asm-offsets.h b/arch/arm64/include/asm/asm-offsets.h index d370ee36a182..7d6531a81eb3 100644 --- a/arch/arm64/include/asm/asm-offsets.h +++ b/arch/arm64/include/asm/asm-offsets.h @@ -1 +1,3 @@ +#if !defined(__GENERATING_ASM_OFFSETS_H) && !defined(__GENERATING_BOUNDS_H) #include +#endif diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c index 742887330101..5ab8841af382 100644 --- a/arch/arm64/kernel/asm-offsets.c +++ b/arch/arm64/kernel/asm-offsets.c @@ -18,6 +18,8 @@ * along with this program. If not, see . */ +#define __GENERATING_ASM_OFFSETS_H 1 + #include #include #include