Skip to content

Commit d40e0d4

Browse files
paulburtonralfbaechle
authored andcommitted
locking/qspinlock: Include linux/prefetch.h
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>
1 parent e5f5a5b commit d40e0d4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/locking/qspinlock.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <linux/percpu.h>
2929
#include <linux/hardirq.h>
3030
#include <linux/mutex.h>
31+
#include <linux/prefetch.h>
3132
#include <asm/byteorder.h>
3233
#include <asm/qspinlock.h>
3334

0 commit comments

Comments
 (0)