linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Petr Mladek <pmladek@suse.com>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	"Steven Rostedt (VMware)" <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, Waiman Long <longman@redhat.com>
Subject: [PATCH 2/2] locking/qspinlock: Do not include atomic.h from qspinlock_types.h
Date: Wed, 29 Jul 2020 22:33:16 +1000	[thread overview]
Message-ID: <20200729123316.GC7047@gondor.apana.org.au> (raw)
In-Reply-To: <20200729122807.GA7047@gondor.apana.org.au>

This patch breaks a header loop involving qspinlock_types.h.
The issue is that qspinlock_types.h includes atomic.h, which then
eventually includes kernel.h which could lead back to the original
file via spinlock_types.h.

As ATOMIC_INIT is now defined by linux/types.h, there is no longer
any need to include atomic.h from qspinlock_types.h.  This also
allows the CONFIG_PARAVIRT hack to be removed since it was trying
to prevent exactly this loop.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/include/asm-generic/qspinlock.h b/include/asm-generic/qspinlock.h
index 38ca14e79a86..4fe7fd0fe834 100644
--- a/include/asm-generic/qspinlock.h
+++ b/include/asm-generic/qspinlock.h
@@ -11,6 +11,7 @@
 #define __ASM_GENERIC_QSPINLOCK_H
 
 #include <asm-generic/qspinlock_types.h>
+#include <linux/atomic.h>
 
 #ifndef queued_spin_is_locked
 /**
diff --git a/include/asm-generic/qspinlock_types.h b/include/asm-generic/qspinlock_types.h
index 56d1309d32f8..2fd1fb89ec36 100644
--- a/include/asm-generic/qspinlock_types.h
+++ b/include/asm-generic/qspinlock_types.h
@@ -9,15 +9,7 @@
 #ifndef __ASM_GENERIC_QSPINLOCK_TYPES_H
 #define __ASM_GENERIC_QSPINLOCK_TYPES_H
 
-/*
- * Including atomic.h with PARAVIRT on will cause compilation errors because
- * of recursive header file incluson via paravirt_types.h. So don't include
- * it if PARAVIRT is on.
- */
-#ifndef CONFIG_PARAVIRT
 #include <linux/types.h>
-#include <linux/atomic.h>
-#endif
 
 typedef struct qspinlock {
 	union {
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  parent reply	other threads:[~2020-07-29 12:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 11:03 linux-next: build failure after merge of the printk tree Stephen Rothwell
2020-07-29 11:47 ` Herbert Xu
2020-07-29 12:28   ` [PATCH 0/2] locking/qspinlock: Break qspinlock_types.h header loop Herbert Xu
2020-07-29 12:31     ` [PATCH 1/2] locking/atomic: Move ATOMIC_INIT into linux/types.h Herbert Xu
2020-07-29 14:33       ` [tip: locking/core] " tip-bot2 for Herbert Xu
2020-07-29 12:33     ` Herbert Xu [this message]
2020-07-29 14:33       ` [tip: locking/core] locking/qspinlock: Do not include atomic.h from qspinlock_types.h tip-bot2 for Herbert Xu
2020-07-29 12:47     ` [PATCH 0/2] locking/qspinlock: Break qspinlock_types.h header loop peterz
2020-07-29 12:51       ` Herbert Xu
2020-07-29 13:00         ` peterz
2020-07-29 13:28           ` Sergey Senozhatsky
2020-07-29 14:28             ` peterz
2020-07-29 16:41               ` Sergey Senozhatsky
2020-07-29 13:35     ` Waiman Long
2020-07-29 15:04       ` Andy Shevchenko
2020-07-30  0:59         ` Herbert Xu
2020-07-30  7:47           ` Andy Shevchenko
2020-07-30  7:50             ` Herbert Xu
2020-07-30  7:55               ` Andy Shevchenko
2020-08-06  3:37               ` Vineet Gupta
2020-07-29 17:50     ` Sergey Senozhatsky

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=20200729123316.GC7047@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=andy.shevchenko@gmail.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=sfr@canb.auug.org.au \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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).