========== checkpatch - FAILED WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #49: new file mode 100644 WARNING: Improper SPDX comment style for 'tools/testing/selftests/bpf/bpf_arena_spin_lock.h', please use '/*' instead #54: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:1: +// SPDX-License-Identifier: GPL-2.0 WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #54: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:1: +// SPDX-License-Identifier: GPL-2.0 WARNING: line length of 95 exceeds 80 columns #63: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:10: +#define arch_mcs_spin_lock_contended_label(l, label) smp_cond_load_acquire_label(l, VAL, label) WARNING: memory barrier without comment #64: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:11: +#define arch_mcs_spin_unlock_contended(l) smp_store_release((l), 1) CHECK: spaces preferred around that '*' (ctx:WxV) #83: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:30: + struct arena_mcs_spinlock __arena *next; ^ CHECK: Prefer using the BIT macro #127: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:74: +#define _Q_LOCKED_VAL (1U << _Q_LOCKED_OFFSET) CHECK: Prefer using the BIT macro #128: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:75: +#define _Q_PENDING_VAL (1U << _Q_PENDING_OFFSET) CHECK: spaces preferred around that '*' (ctx:WxV) #150: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:97: +static inline struct arena_mcs_spinlock __arena *decode_tail(u32 tail) ^ WARNING: line length of 99 exceeds 80 columns #158: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:105: + bpf_printk("RUNTIME ERROR: %s idx=%u and cpu=%u are out-of-bounds!!!", __func__, idx, cpu); WARNING: line length of 98 exceeds 80 columns #163: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:110: +struct arena_mcs_spinlock __arena *grab_mcs_node(struct arena_mcs_spinlock __arena *base, int idx) CHECK: spaces preferred around that '*' (ctx:WxV) #163: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:110: +struct arena_mcs_spinlock __arena *grab_mcs_node(struct arena_mcs_spinlock __arena *base, int idx) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #163: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:110: +struct arena_mcs_spinlock __arena *grab_mcs_node(struct arena_mcs_spinlock __arena *base, int idx) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #180: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:127: +static __always_inline u32 xchg_tail(arena_spinlock_t __arena *lock, u32 tail) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #210: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:157: +static __always_inline void clear_pending(arena_spinlock_t __arena *lock) ^ WARNING: line length of 84 exceeds 80 columns #223: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:170: +static __always_inline void clear_pending_set_locked(arena_spinlock_t __arena *lock) CHECK: spaces preferred around that '*' (ctx:WxV) #223: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:170: +static __always_inline void clear_pending_set_locked(arena_spinlock_t __arena *lock) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #234: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:181: +static __always_inline void set_locked(arena_spinlock_t __arena *lock) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #240: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:187: +u32 arena_fetch_set_pending_acquire(arena_spinlock_t __arena *lock) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #265: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:212: +static __always_inline int arena_spin_trylock(arena_spinlock_t __arena *lock) ^ WARNING: line length of 83 exceeds 80 columns #272: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:219: + return likely(atomic_try_cmpxchg_acquire(&lock->val, &val, _Q_LOCKED_VAL)); WARNING: line length of 81 exceeds 80 columns #276: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:223: +int arena_spin_lock_slowpath(arena_spinlock_t __arena __arg_arena *lock, u32 val) CHECK: spaces preferred around that '*' (ctx:WxV) #276: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:223: +int arena_spin_lock_slowpath(arena_spinlock_t __arena __arg_arena *lock, u32 val) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #278: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:225: + struct arena_mcs_spinlock __arena *prev, *next, *node0, *node; ^ WARNING: Missing a blank line after declarations #291: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:238: + int cnt = _Q_PENDING_LOOPS; + val = atomic_cond_read_relaxed_label(&lock->val, WARNING: line length of 87 exceeds 80 columns #292: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:239: + (VAL != _Q_PENDING_VAL) || !cnt--, CHECK: Blank lines aren't necessary after an open brace '{' #317: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:264: + if (unlikely(val & ~_Q_LOCKED_MASK)) { + CHECK: Unnecessary parentheses around qnodes[bpf_get_smp_processor_id() + 1] #353: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:300: + node0 = &(qnodes[bpf_get_smp_processor_id() + 1])[0].mcs; WARNING: line length of 84 exceeds 80 columns #416: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:363: + arch_mcs_spin_lock_contended_label(&node->locked, release_node_err); WARNING: line length of 89 exceeds 80 columns #437: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:384: + val = atomic_cond_read_acquire_label(&lock->val, !(VAL & _Q_LOCKED_PENDING_MASK), WARNING: line length of 89 exceeds 80 columns #477: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:424: + next = smp_cond_load_relaxed_label(&node->next, (VAL), release_node_err); CHECK: spaces preferred around that '*' (ctx:WxV) #509: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:456: +static __always_inline int arena_spin_lock(arena_spinlock_t __arena *lock) ^ WARNING: line length of 91 exceeds 80 columns #521: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:468: + /* FIXME: bpf_assert_range(-MAX_ERRNO, 0) once we have it working for all cases. */ CHECK: spaces preferred around that '*' (ctx:WxV) #531: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:478: +static __always_inline void arena_spin_unlock(arena_spinlock_t __arena *lock) ^ WARNING: Improper SPDX comment style for 'tools/testing/selftests/bpf/bpf_atomic.h', please use '/*' instead #565: FILE: tools/testing/selftests/bpf/bpf_atomic.h:1: +// SPDX-License-Identifier: GPL-2.0 WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #565: FILE: tools/testing/selftests/bpf/bpf_atomic.h:1: +// SPDX-License-Identifier: GPL-2.0 WARNING: Prefer 'unsigned int' to bare use of 'unsigned' #577: FILE: tools/testing/selftests/bpf/bpf_atomic.h:13: + unsigned type : (unsigned type)0, signed type : (signed type)0 WARNING: Prefer 'signed int' to bare use of 'signed' #577: FILE: tools/testing/selftests/bpf/bpf_atomic.h:13: + unsigned type : (unsigned type)0, signed type : (signed type)0 ERROR: spaces required around that ':' (ctx:VxW) #588: FILE: tools/testing/selftests/bpf/bpf_atomic.h:24: + char: (char)0, \ ^ WARNING: labels should not be indented #588: FILE: tools/testing/selftests/bpf/bpf_atomic.h:24: + char: (char)0, \ ERROR: spaces required around that ':' (ctx:VxW) #594: FILE: tools/testing/selftests/bpf/bpf_atomic.h:30: + default: (void *)0)) ^ ERROR: trailing statements should be on next line #594: FILE: tools/testing/selftests/bpf/bpf_atomic.h:30: + default: (void *)0)) WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #599: FILE: tools/testing/selftests/bpf/bpf_atomic.h:35: +#define READ_ONCE(x) (*(volatile typeof(x) *)&(x)) WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #601: FILE: tools/testing/selftests/bpf/bpf_atomic.h:37: +#define WRITE_ONCE(x, val) ((*(volatile typeof(x) *)&(x)) = (val)) WARNING: memory barrier without comment #618: FILE: tools/testing/selftests/bpf/bpf_atomic.h:54: +#define smp_mb() \ WARNING: memory barrier without comment #624: FILE: tools/testing/selftests/bpf/bpf_atomic.h:60: +#define smp_rmb() \ WARNING: memory barrier without comment #627: FILE: tools/testing/selftests/bpf/bpf_atomic.h:63: + smp_mb(); \ WARNING: memory barrier without comment #632: FILE: tools/testing/selftests/bpf/bpf_atomic.h:68: +#define smp_wmb() \ WARNING: memory barrier without comment #635: FILE: tools/testing/selftests/bpf/bpf_atomic.h:71: + smp_mb(); \ WARNING: memory barrier without comment #643: FILE: tools/testing/selftests/bpf/bpf_atomic.h:79: +#define smp_load_acquire(p) \ WARNING: memory barrier without comment #647: FILE: tools/testing/selftests/bpf/bpf_atomic.h:83: + smp_mb(); \ WARNING: memory barrier without comment #652: FILE: tools/testing/selftests/bpf/bpf_atomic.h:88: +#define smp_store_release(p, val) \ WARNING: memory barrier without comment #655: FILE: tools/testing/selftests/bpf/bpf_atomic.h:91: + smp_mb(); \ CHECK: Macro argument 'p' may be better as '(p)' to avoid precedence issues #674: FILE: tools/testing/selftests/bpf/bpf_atomic.h:110: +#define smp_cond_load_acquire_label(p, cond_expr, label) \ + ({ \ + __unqual_typeof(*p) __val = \ + smp_cond_load_relaxed_label(p, cond_expr, label); \ + smp_acquire__after_ctrl_dep(); \ + (typeof(*(p)))__val; \ + }) total: 3 errors, 32 warnings, 19 checks, 637 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 b8d88df2c613 ("selftests/bpf: Introduce arena spin lock") has style problems, please review. NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT BAD_REPORTED_BY_LINK CAMELCASE COMMIT_LOG_LONG_LINE 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.