Skip to content

Commit 9bc0bd9

Browse files
t-8chandreas-gaisler
authored andcommitted
sparc: Avoid -Wunused-but-set-parameter in clear_user_page()
The loop in clear_user_pages() iterates over all pages and calls clear_user_page() for each of them. During the loop "vaddr" is modified. However on sparc clear_user() is a macro which does not use "vaddr". The compiler sees a variable which is modified but never used and emits a warning for that: include/linux/highmem.h: In function 'clear_user_pages': include/linux/highmem.h:234:63: warning: parameter 'vaddr' set but not used [-Wunused-but-set-parameter=] static inline void clear_user_pages(void *addr, unsigned long vaddr, Other architectures use an inline function for clear_user_page() which avoids the warning. This is not possible on sparc, as sparc_flush_page_to_ram() is not yet declared where clear_user_page() is defined. Including cacheflush_32.h will trigger recursive and lots of other issues. So hide the warning with a cast to (void) instead. While we are here, do the same for copy_user_page(). Fixes: 62a9f5a ("mm: introduce clear_pages() and clear_user_pages()") Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Andreas Larsson <andreas@gaisler.com> Signed-off-by: Andreas Larsson <andreas@gaisler.com>
1 parent 1919c0e commit 9bc0bd9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

arch/sparc/include/asm/page_32.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
#define clear_user_page(addr, vaddr, page) \
2121
do { clear_page(addr); \
2222
sparc_flush_page_to_ram(page); \
23+
(void)(vaddr); \
2324
} while (0)
2425
#define copy_user_page(to, from, vaddr, page) \
2526
do { copy_page(to, from); \
2627
sparc_flush_page_to_ram(page); \
28+
(void)(vaddr); \
2729
} while (0)
2830

2931
/* The following structure is used to hold the physical

0 commit comments

Comments
 (0)