]> git.baikalelectronics.ru Git - kernel.git/commitdiff
locking/qspinlock: Include linux/prefetch.h
authorPaul Burton <paul.burton@imgtec.com>
Wed, 5 Jul 2017 16:59:05 +0000 (09:59 -0700)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 11 Jul 2017 12:35:12 +0000 (14:35 +0200)
kernel/locking/qspinlock.c makes use of prefetchw() but hasn't included
linux/prefetch.h up until now, instead relying upon indirect inclusion
of some header that defines prefetchw().

In the case of MIPS we generally obtain a definition of prefetchw() from
asm/processor.h, included by way of linux/mutex.h, but only for
configurations which select CONFIG_CPU_HAS_PREFETCH. For configurations
which don't this leaves prefetchw() undefined leading to the following
build failure:

  CC      kernel/locking/qspinlock.o
  kernel/locking/qspinlock.c: In function ‘queued_spin_lock_slowpath’:
  kernel/locking/qspinlock.c:549:4: error: implicit declaration of
      function ‘prefetchw’ [-Werror=implicit-function-declaration]
    prefetchw(next);
    ^~~~~~~~~

Fix this by including linux/prefetch.h in order to ensure that we get a
definition of prefetchw().

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
kernel/locking/qspinlock.c

index b2caec7315af5b622a00f8babfd55bb3f27fb315..fd24153e8a48db3bcf3c2be46270177a196529da 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/percpu.h>
 #include <linux/hardirq.h>
 #include <linux/mutex.h>
+#include <linux/prefetch.h>
 #include <asm/byteorder.h>
 #include <asm/qspinlock.h>