[PATCH] asm-generic: unistd.h: make 'compat_sys_fadvise64_64' conditional

Randy Dunlap rdunlap at infradead.org
Sun Aug 7 10:28:54 PDT 2022


Don't require 'compat_sys_fadvise64_64' when
__ARCH_WANT_COMPAT_FADVISE64_64 is not set.

Fixes this build error when CONFIG_ADVISE_SYSCALLS is not set:

include/uapi/asm-generic/unistd.h:649:49: error: 'compat_sys_fadvise64_64' undeclared here (not in a function); did you mean 'ksys_fadvise64_64'?
  649 | __SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64)
arch/riscv/kernel/compat_syscall_table.c:12:42: note: in definition of macro '__SYSCALL'
   12 | #define __SYSCALL(nr, call)      [nr] = (call),
include/uapi/asm-generic/unistd.h:649:1: note: in expansion of macro '__SC_COMP'
  649 | __SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64)

Signed-off-by: Randy Dunlap <rdunlap at infradead.org>
Cc: Paul Walmsley <paul.walmsley at sifive.com>
Cc: Palmer Dabbelt <palmer at dabbelt.com>
Cc: Albert Ou <aou at eecs.berkeley.edu>
Cc: linux-riscv at lists.infradead.org
Cc: Arnd Bergmann <arnd at arndb.de>
Cc: linux-arch at vger.kernel.org
Cc: Andrew Morton <akpm at linux-foundation.org>
Cc: linux-mm at kvack.org
---
 include/uapi/asm-generic/unistd.h |    2 ++
 1 file changed, 2 insertions(+)

--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
@@ -645,8 +645,10 @@ __SC_COMP(__NR_execve, sys_execve, compa
 #define __NR3264_mmap 222
 __SC_3264(__NR3264_mmap, sys_mmap2, sys_mmap)
 /* mm/fadvise.c */
+#ifdef __ARCH_WANT_COMPAT_FADVISE64_64
 #define __NR3264_fadvise64 223
 __SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64)
+#endif
 
 /* mm/, CONFIG_MMU only */
 #ifndef __ARCH_NOMMU



More information about the linux-riscv mailing list