linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Babu Moger <babu.moger@oracle.com>
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
Subject: [PATCH v2 1/7] kernel/locking: Fix compile error with qrwlock.c
Date: Fri, 19 May 2017 18:16:55 -0600	[thread overview]
Message-ID: <1495239421-441642-2-git-send-email-babu.moger@oracle.com> (raw)
In-Reply-To: <1495239421-441642-1-git-send-email-babu.moger@oracle.com>

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 <babu.moger@oracle.com>
Reviewed-by: Håkon Bugge <haakon.bugge@oracle.com>
Reviewed-by: Jane Chu <jane.chu@oracle.com>
Reviewed-by: Shannon Nelson <shannon.nelson@oracle.com>
Reviewed-by: Vijay Kumar <vijay.ac.kumar@oracle.com>
---
 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 <linux/types.h>
-#include <asm/spinlock_types.h>
-
 /*
  * The queue read/write lock data structure
  */
@@ -18,4 +15,7 @@
 	.wait_lock = __ARCH_SPIN_LOCK_UNLOCKED,	\
 }
 
+#include <linux/types.h>
+#include <linux/spinlock_types.h>
+
 #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 <linux/cpumask.h>
 #include <linux/percpu.h>
 #include <linux/hardirq.h>
+#include <linux/spinlock.h>
 #include <asm/qrwlock.h>
 
 /*
-- 
1.7.1

  parent reply	other threads:[~2017-05-20  0:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-20  0:16 [PATCH v2 0/7] Enable queued rwlock and queued spinlock for SPARC Babu Moger
2017-05-20  0:16 ` Babu Moger
2017-05-20  0:16 ` Babu Moger [this message]
2017-05-20  0:16   ` [PATCH v2 1/7] kernel/locking: Fix compile error with qrwlock.c Babu Moger
2017-05-22 19:03   ` David Miller
2017-05-22 21:57     ` Babu Moger
2017-05-22 23:00       ` David Miller
2017-05-20  0:16 ` [PATCH v2 2/7] arch/sparc: Remove the check #ifndef __LINUX_SPINLOCK_TYPES_H Babu Moger
2017-05-20  0:16 ` [PATCH v2 3/7] arch/sparc: Define config parameter CPU_BIG_ENDIAN Babu Moger
2017-05-20  0:16   ` Babu Moger
2017-05-20  0:16 ` [PATCH v2 4/7] arch/sparc: Introduce cmpxchg_u8 SPARC Babu Moger
2017-05-20  0:16 ` [PATCH v2 5/7] arch/sparc: Enable queued rwlocks for SPARC Babu Moger
2017-05-20  0:16   ` Babu Moger
2017-05-20  0:17 ` [PATCH v2 6/7] arch/sparc: Introduce xchg16 " Babu Moger
2017-05-20  0:17   ` Babu Moger
2017-05-20  0:17 ` [PATCH v2 7/7] arch/sparc: Enable queued spinlock support " Babu Moger
2017-05-20  0:17   ` Babu Moger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1495239421-441642-2-git-send-email-babu.moger@oracle.com \
    --to=babu.moger@oracle.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=haakon.bugge@oracle.com \
    --cc=jane.chu@oracle.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=shannon.nelson@oracle.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=steven.sistare@oracle.com \
    --cc=vijay.ac.kumar@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).