--- zzzz-none-000/linux-4.1.52/include/linux/kernel.h 2018-05-28 02:26:45.000000000 +0000 +++ bcm63-7530ax-731/linux-4.1.52/include/linux/kernel.h 2022-03-02 11:37:13.000000000 +0000 @@ -53,6 +53,14 @@ #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) +#if defined(CONFIG_BCM_KF_OPTEE_414_BACKPORTS) +#define u64_to_user_ptr(x) ( \ +{ \ + typecheck(u64, x); \ + (void __user *)(uintptr_t)x; \ +} \ +) +#endif /* CONFIG_BCM_KF_OPTEE_414_BACKPORTS */ /* * This looks more complex than it should be. But we need to * get the type for the ~ right in round_down (it needs to be @@ -190,10 +198,10 @@ do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0) # define sched_annotate_sleep() (current->task_state_change = 0) #else - static inline void ___might_sleep(const char *file, int line, - int preempt_offset) { } - static inline void __might_sleep(const char *file, int line, - int preempt_offset) { } + static inline void ___might_sleep(const char *file __maybe_unused, int line __maybe_unused, + int preempt_offset __maybe_unused) { } + static inline void __might_sleep(const char *file __maybe_unused, int line __maybe_unused, + int preempt_offset __maybe_unused) { } # define might_sleep() do { might_resched(); } while (0) # define sched_annotate_sleep() do { } while (0) #endif @@ -556,7 +564,7 @@ extern void tracing_stop(void); static inline __printf(1, 2) -void ____trace_printk_check_format(const char *fmt, ...) +void ____trace_printk_check_format(const char *fmt __maybe_unused, ...) { } #define __trace_printk_check_format(fmt, args...) \ @@ -691,7 +699,7 @@ #else static inline void tracing_start(void) { } static inline void tracing_stop(void) { } -static inline void trace_dump_stack(int skip) { } +static inline void trace_dump_stack(int skip __maybe_unused) { } static inline void tracing_on(void) { } static inline void tracing_off(void) { } @@ -700,16 +708,16 @@ static inline void tracing_snapshot_alloc(void) { } static inline __printf(1, 2) -int trace_printk(const char *fmt, ...) +int trace_printk(const char *fmt __maybe_unused, ...) { return 0; } static inline int -ftrace_vprintk(const char *fmt, va_list ap) +ftrace_vprintk(const char *fmt __maybe_unused, va_list ap __maybe_unused) { return 0; } -static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } +static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode __maybe_unused) { } #endif /* CONFIG_TRACING */ /* @@ -720,7 +728,7 @@ #define min(x, y) ({ \ typeof(x) _min1 = (x); \ typeof(y) _min2 = (y); \ - (void) (&_min1 == &_min2); \ + (void) ((void *)(&_min1) == (void *)(&_min2)); \ _min1 < _min2 ? _min1 : _min2; }) #define max(x, y) ({ \