WARNING: Argument 'ptr' is not used in function-like macro #54: FILE: include/asm-generic/barrier.h:284: +#define cpu_poll_relax(ptr, val, timeout_ns) cpu_relax() WARNING: Argument 'val' is not used in function-like macro #54: FILE: include/asm-generic/barrier.h:284: +#define cpu_poll_relax(ptr, val, timeout_ns) cpu_relax() WARNING: Argument 'timeout_ns' is not used in function-like macro #54: FILE: include/asm-generic/barrier.h:284: +#define cpu_poll_relax(ptr, val, timeout_ns) cpu_relax() WARNING: Macros with flow control statements should be avoided #70: FILE: include/asm-generic/barrier.h:300: +#define smp_cond_load_relaxed_timeout(ptr, cond_expr, \ + time_expr_ns, timeout_ns) \ +({ \ + __label__ __out, __done; \ + typeof(ptr) __PTR = (ptr); \ + __unqual_scalar_typeof(*ptr) VAL; \ + u32 __n = 0, __spin = SMP_TIMEOUT_POLL_COUNT; \ + s64 __time_now = (s64)(time_expr_ns); \ + s64 __timeout = (s64)timeout_ns; \ + s64 __time_end = __time_now + __timeout; \ + \ + if (__time_now <= 0) \ + goto __out; \ + \ + for (;;) { \ + VAL = READ_ONCE(*__PTR); \ + if (cond_expr) \ + goto __done; \ + cpu_poll_relax(__PTR, VAL, __timeout); \ + if (++__n < __spin) \ + continue; \ + __time_now = (s64)(time_expr_ns); \ + __timeout = __time_end - __time_now; \ + if (__time_now <= 0 || __timeout <= 0) \ + goto __out; \ + __n = 0; \ + } \ +__out: \ + VAL = READ_ONCE(*__PTR); \ +__done: \ + (typeof(*ptr))VAL; \ +}) total: 0 errors, 4 warnings, 0 checks, 64 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. Commit 4c91efe39cf8 ("asm-generic: barrier: Add smp_cond_load_relaxed_timeout()") has style problems, please review. NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT BAD_REPORTED_BY_LINK CAMELCASE COMMIT_LOG_LONG_LINE FILE_PATH_CHANGES GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 4 warnings, 0 checks, 64 lines checked