Messages in this thread Patch in this message | | | From | Nathan Chancellor <> | Subject | [PATCH 2/2] asm-generic: Make cacheflush.h self-contained | Date | Mon, 22 Jun 2020 16:47:40 -0700 |
| |
Currently, cacheflush.h has to be included after mm.h to avoid several -Wvisibility warnings:
$ clang -Wvisibility -fsyntax-only include/asm-generic/cacheflush.h include/asm-generic/cacheflush.h:16:42: warning: declaration of 'struct mm_struct' will not be visible outside of this function [-Wvisibility] static inline void flush_cache_mm(struct mm_struct *mm) ^ ... include/asm-generic/cacheflush.h:28:45: warning: declaration of 'struct vm_area_struct' will not be visible outside of this function [-Wvisibility] static inline void flush_cache_range(struct vm_area_struct *vma, ^ ...
Add a few forward declarations should that there are no warnings and the ordering of the includes does not matter.
Fixes: e0cf615d725c ("asm-generic: don't include <linux/mm.h> in cacheflush.h") Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> --- include/asm-generic/cacheflush.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/include/asm-generic/cacheflush.h b/include/asm-generic/cacheflush.h index 907fa5d16494..093b743da596 100644 --- a/include/asm-generic/cacheflush.h +++ b/include/asm-generic/cacheflush.h @@ -2,6 +2,11 @@ #ifndef _ASM_GENERIC_CACHEFLUSH_H #define _ASM_GENERIC_CACHEFLUSH_H +struct address_space; +struct mm_struct; +struct page; +struct vm_area_struct; + /* * The cache doesn't need to be flushed when TLB entries change when * the cache is mapped to physical memory, not virtual memory -- 2.27.0
| |