WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #43: new file mode 100644 WARNING: Improper SPDX comment style for 'tools/testing/selftests/bpf/bpf_arena_spin_lock.h', please use '/*' instead #48: 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 #48: 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 #57: 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 #58: 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) #77: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:30: + struct arena_mcs_spinlock __arena *next; ^ CHECK: Prefer using the BIT macro #121: 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 #122: 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) #139: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:92: +static inline struct arena_mcs_spinlock __arena *decode_tail(u32 tail) ^ WARNING: line length of 98 exceeds 80 columns #148: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:101: +struct arena_mcs_spinlock __arena *grab_mcs_node(struct arena_mcs_spinlock __arena *base, int idx) CHECK: spaces preferred around that '*' (ctx:WxV) #148: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:101: +struct arena_mcs_spinlock __arena *grab_mcs_node(struct arena_mcs_spinlock __arena *base, int idx) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #148: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:101: +struct arena_mcs_spinlock __arena *grab_mcs_node(struct arena_mcs_spinlock __arena *base, int idx) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #165: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:118: +static __always_inline u32 xchg_tail(arena_spinlock_t __arena *lock, u32 tail) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #195: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:148: +static __always_inline void clear_pending(arena_spinlock_t __arena *lock) ^ WARNING: line length of 84 exceeds 80 columns #208: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:161: +static __always_inline void clear_pending_set_locked(arena_spinlock_t __arena *lock) CHECK: spaces preferred around that '*' (ctx:WxV) #208: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:161: +static __always_inline void clear_pending_set_locked(arena_spinlock_t __arena *lock) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #219: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:172: +static __always_inline void set_locked(arena_spinlock_t __arena *lock) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #225: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:178: +u32 arena_fetch_set_pending_acquire(arena_spinlock_t __arena *lock) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #250: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:203: +static __always_inline int arena_spin_trylock(arena_spinlock_t __arena *lock) ^ WARNING: line length of 83 exceeds 80 columns #257: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:210: + return likely(atomic_try_cmpxchg_acquire(&lock->val, &val, _Q_LOCKED_VAL)); WARNING: line length of 81 exceeds 80 columns #261: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:214: +int arena_spin_lock_slowpath(arena_spinlock_t __arena __arg_arena *lock, u32 val) CHECK: spaces preferred around that '*' (ctx:WxV) #261: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:214: +int arena_spin_lock_slowpath(arena_spinlock_t __arena __arg_arena *lock, u32 val) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #263: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:216: + struct arena_mcs_spinlock __arena *prev, *next, *node0, *node; ^ WARNING: Missing a blank line after declarations #276: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:229: + int cnt = _Q_PENDING_LOOPS; + val = atomic_cond_read_relaxed_label(&lock->val, WARNING: line length of 87 exceeds 80 columns #277: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:230: + (VAL != _Q_PENDING_VAL) || !cnt--, CHECK: Blank lines aren't necessary after an open brace '{' #302: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:255: + if (unlikely(val & ~_Q_LOCKED_MASK)) { + CHECK: Unnecessary parentheses around qnodes[bpf_get_smp_processor_id()] #337: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:290: + node0 = &(qnodes[bpf_get_smp_processor_id()])[0].mcs; WARNING: line length of 84 exceeds 80 columns #400: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:353: + arch_mcs_spin_lock_contended_label(&node->locked, release_node_err); WARNING: line length of 89 exceeds 80 columns #421: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:374: + val = atomic_cond_read_acquire_label(&lock->val, !(VAL & _Q_LOCKED_PENDING_MASK), WARNING: line length of 89 exceeds 80 columns #461: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:414: + next = smp_cond_load_relaxed_label(&node->next, (VAL), release_node_err); CHECK: spaces preferred around that '*' (ctx:WxV) #493: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:446: +static __always_inline int arena_spin_lock(arena_spinlock_t __arena *lock) ^ WARNING: line length of 91 exceeds 80 columns #505: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:458: + /* FIXME: bpf_assert_range(-MAX_ERRNO, 0) once we have it working for all cases. */ CHECK: spaces preferred around that '*' (ctx:WxV) #515: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:468: +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 #549: 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 #549: FILE: tools/testing/selftests/bpf/bpf_atomic.h:1: +// SPDX-License-Identifier: GPL-2.0 WARNING: Prefer 'unsigned int' to bare use of 'unsigned' #561: 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' #561: 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) #573: FILE: tools/testing/selftests/bpf/bpf_atomic.h:25: + char: (char)0, \ ^ WARNING: labels should not be indented #573: FILE: tools/testing/selftests/bpf/bpf_atomic.h:25: + char: (char)0, \ ERROR: spaces required around that ':' (ctx:VxW) #579: FILE: tools/testing/selftests/bpf/bpf_atomic.h:31: + default: (typeof(x))0)) ^ ERROR: trailing statements should be on next line #579: FILE: tools/testing/selftests/bpf/bpf_atomic.h:31: + default: (typeof(x))0)) WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #584: FILE: tools/testing/selftests/bpf/bpf_atomic.h:36: +#define READ_ONCE(x) (*(volatile typeof(x) *)&(x)) WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #586: FILE: tools/testing/selftests/bpf/bpf_atomic.h:38: +#define WRITE_ONCE(x, val) ((*(volatile typeof(x) *)&(x)) = (val)) WARNING: memory barrier without comment #603: FILE: tools/testing/selftests/bpf/bpf_atomic.h:55: +#define smp_mb() \ WARNING: memory barrier without comment #609: FILE: tools/testing/selftests/bpf/bpf_atomic.h:61: +#define smp_rmb() \ WARNING: memory barrier without comment #612: FILE: tools/testing/selftests/bpf/bpf_atomic.h:64: + smp_mb(); \ WARNING: memory barrier without comment #617: FILE: tools/testing/selftests/bpf/bpf_atomic.h:69: +#define smp_wmb() \ WARNING: memory barrier without comment #620: FILE: tools/testing/selftests/bpf/bpf_atomic.h:72: + smp_mb(); \ WARNING: memory barrier without comment #628: FILE: tools/testing/selftests/bpf/bpf_atomic.h:80: +#define smp_load_acquire(p) \ WARNING: memory barrier without comment #632: FILE: tools/testing/selftests/bpf/bpf_atomic.h:84: + smp_mb(); \ WARNING: memory barrier without comment #637: FILE: tools/testing/selftests/bpf/bpf_atomic.h:89: +#define smp_store_release(p, val) \ WARNING: memory barrier without comment #640: FILE: tools/testing/selftests/bpf/bpf_atomic.h:92: + smp_mb(); \ CHECK: Macro argument 'p' may be better as '(p)' to avoid precedence issues #659: FILE: tools/testing/selftests/bpf/bpf_atomic.h:111: +#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, 31 warnings, 19 checks, 628 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 28e34d27a5c6 ("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.