From mboxrd@z Thu Jan 1 00:00:00 1970 From: Babu Moger Subject: [PATCH v2 1/7] kernel/locking: Fix compile error with qrwlock.c Date: Fri, 19 May 2017 18:16:55 -0600 Message-ID: <1495239421-441642-2-git-send-email-babu.moger@oracle.com> References: <1495239421-441642-1-git-send-email-babu.moger@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <1495239421-441642-1-git-send-email-babu.moger@oracle.com> Sender: linux-kernel-owner@vger.kernel.org To: davem@davemloft.net, peterz@infradead.org, mingo@redhat.com, arnd@arndb.de Cc: babu.moger@oracle.com, shannon.nelson@oracle.com, haakon.bugge@oracle.com, steven.sistare@oracle.com, vijay.ac.kumar@oracle.com, jane.chu@oracle.com, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org List-Id: linux-arch.vger.kernel.org Some architectures use the following guard in include file "asm/spinlock_types.h" to discourage including the file directly. Saw these compile errors on SPARC when queued rwlock feature is enabled. CC kernel/locking/qrwlock.o In file included from ./include/asm-generic/qrwlock_types.h:5, from ./arch/sparc/include/asm/qrwlock.h:4, from kernel/locking/qrwlock.c:24: ./arch/sparc/include/asm/spinlock_types.h:5:3: error: #error "please don't include this file directly" Re-arrange the includes in qrwlock_types.h and include spinlock.h in qrwlock.c to fix it. Also will be removing this stanza from SPARC. Stay tuned. Signed-off-by: Babu Moger Reviewed-by: Håkon Bugge Reviewed-by: Jane Chu Reviewed-by: Shannon Nelson Reviewed-by: Vijay Kumar --- include/asm-generic/qrwlock_types.h | 6 +++--- kernel/locking/qrwlock.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/qrwlock_types.h b/include/asm-generic/qrwlock_types.h index 0abc6b6..3988c7d 100644 --- a/include/asm-generic/qrwlock_types.h +++ b/include/asm-generic/qrwlock_types.h @@ -1,9 +1,6 @@ #ifndef __ASM_GENERIC_QRWLOCK_TYPES_H #define __ASM_GENERIC_QRWLOCK_TYPES_H -#include -#include - /* * The queue read/write lock data structure */ @@ -18,4 +15,7 @@ .wait_lock = __ARCH_SPIN_LOCK_UNLOCKED, \ } +#include +#include + #endif /* __ASM_GENERIC_QRWLOCK_TYPES_H */ diff --git a/kernel/locking/qrwlock.c b/kernel/locking/qrwlock.c index cc3ed0c..2655f26 100644 --- a/kernel/locking/qrwlock.c +++ b/kernel/locking/qrwlock.c @@ -20,6 +20,7 @@ #include #include #include +#include #include /* -- 1.7.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp1040.oracle.com ([156.151.31.81]:17655 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757489AbdETARz (ORCPT ); Fri, 19 May 2017 20:17:55 -0400 From: Babu Moger Subject: [PATCH v2 1/7] kernel/locking: Fix compile error with qrwlock.c Date: Fri, 19 May 2017 18:16:55 -0600 Message-ID: <1495239421-441642-2-git-send-email-babu.moger@oracle.com> In-Reply-To: <1495239421-441642-1-git-send-email-babu.moger@oracle.com> References: <1495239421-441642-1-git-send-email-babu.moger@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: davem@davemloft.net, peterz@infradead.org, mingo@redhat.com, arnd@arndb.de Cc: babu.moger@oracle.com, shannon.nelson@oracle.com, haakon.bugge@oracle.com, steven.sistare@oracle.com, vijay.ac.kumar@oracle.com, jane.chu@oracle.com, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Message-ID: <20170520001655.XtGgE_bG1CohLszWBydt4B1-wHAOe-Q7RcnI6569eeA@z> Some architectures use the following guard in include file "asm/spinlock_types.h" to discourage including the file directly. Saw these compile errors on SPARC when queued rwlock feature is enabled. CC kernel/locking/qrwlock.o In file included from ./include/asm-generic/qrwlock_types.h:5, from ./arch/sparc/include/asm/qrwlock.h:4, from kernel/locking/qrwlock.c:24: ./arch/sparc/include/asm/spinlock_types.h:5:3: error: #error "please don't include this file directly" Re-arrange the includes in qrwlock_types.h and include spinlock.h in qrwlock.c to fix it. Also will be removing this stanza from SPARC. Stay tuned. Signed-off-by: Babu Moger Reviewed-by: Håkon Bugge Reviewed-by: Jane Chu Reviewed-by: Shannon Nelson Reviewed-by: Vijay Kumar --- include/asm-generic/qrwlock_types.h | 6 +++--- kernel/locking/qrwlock.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/qrwlock_types.h b/include/asm-generic/qrwlock_types.h index 0abc6b6..3988c7d 100644 --- a/include/asm-generic/qrwlock_types.h +++ b/include/asm-generic/qrwlock_types.h @@ -1,9 +1,6 @@ #ifndef __ASM_GENERIC_QRWLOCK_TYPES_H #define __ASM_GENERIC_QRWLOCK_TYPES_H -#include -#include - /* * The queue read/write lock data structure */ @@ -18,4 +15,7 @@ .wait_lock = __ARCH_SPIN_LOCK_UNLOCKED, \ } +#include +#include + #endif /* __ASM_GENERIC_QRWLOCK_TYPES_H */ diff --git a/kernel/locking/qrwlock.c b/kernel/locking/qrwlock.c index cc3ed0c..2655f26 100644 --- a/kernel/locking/qrwlock.c +++ b/kernel/locking/qrwlock.c @@ -20,6 +20,7 @@ #include #include #include +#include #include /* -- 1.7.1