[Concept,02/10] linux: Use asm/atomic.h in fs, buffer_head, refcount
Commit Message
From: Simon Glass <sjg@chromium.org>
Including <asm-generic/atomic.h> directly in linux/fs.h,
linux/buffer_head.h and linux/refcount.h forces every consumer to the
generic implementation, even on architectures with their own
asm/atomic.h. On x86 this means atomic_add() and friends call
local_irq_save() and local_irq_restore(), which are not declared, so any
file that drags these headers in fails to build with
-Werror=implicit-function-declaration.
Switch the includes to <asm/atomic.h> so each architecture's per-arch
atomic header wins. Architectures without one fall through to
asm-generic transparently.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
include/linux/buffer_head.h | 2 +-
include/linux/fs.h | 2 +-
include/linux/refcount.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
@@ -13,7 +13,7 @@
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/errno.h>
-#include <asm-generic/atomic.h>
+#include <asm/atomic.h>
enum bh_state_bits {
BH_Uptodate, /* Contains valid data */
@@ -14,7 +14,7 @@
#include <linux/cred.h>
#include <linux/rwsem.h>
#include <linux/time.h>
-#include <asm-generic/atomic.h>
+#include <asm/atomic.h>
/* Forward declarations */
struct buffer_head;
@@ -7,7 +7,7 @@
#ifndef _LINUX_REFCOUNT_H
#define _LINUX_REFCOUNT_H
-#include <asm-generic/atomic.h>
+#include <asm/atomic.h>
/**
* typedef refcount_t - reference count type