100-compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch 823 B

1234567891011121314151617181920212223242526272829
  1. From: Felix Fietkau <[email protected]>
  2. Date: Thu, 22 Oct 2020 22:00:03 +0200
  3. Subject: [PATCH] compiler.h: only include asm/rwonce.h for kernel code
  4. This header file is not in uapi, which makes any user space code that includes
  5. linux/compiler.h to fail with the error 'asm/rwonce.h: No such file or directory'
  6. Fixes: e506ea451254 ("compiler.h: Split {READ,WRITE}_ONCE definitions out into rwonce.h")
  7. Signed-off-by: Felix Fietkau <[email protected]>
  8. ---
  9. --- a/include/linux/compiler.h
  10. +++ b/include/linux/compiler.h
  11. @@ -203,6 +203,8 @@ void ftrace_likely_update(struct ftrace_
  12. __v; \
  13. })
  14. +#include <asm/rwonce.h>
  15. +
  16. #endif /* __KERNEL__ */
  17. /*
  18. @@ -243,6 +245,4 @@ static inline void *offset_to_ptr(const
  19. */
  20. #define prevent_tail_call_optimization() mb()
  21. -#include <asm/rwonce.h>
  22. -
  23. #endif /* __LINUX_COMPILER_H */