WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #44: new file mode 100644 WARNING: Improper SPDX comment style for 'tools/testing/selftests/bpf/bpf_arena_spin_lock.h', please use '/*' instead #49: 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 #49: 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 #58: 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 #59: 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) #78: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:30: + struct arena_mcs_spinlock __arena *next; ^ CHECK: Prefer using the BIT macro #122: 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 #123: 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) #140: 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 #149: 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) #149: 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) #149: 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) #166: 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) #196: 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 #209: 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) #209: 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) #220: 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) #226: 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) #251: 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 #258: 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 #262: 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) #262: 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) #264: 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 #277: 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 #278: 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 '{' #303: 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()] #338: 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 #401: 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 #422: 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 #462: 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) #511: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:463: +static __always_inline int arena_spin_lock(arena_spinlock_t __arena *lock) ^ WARNING: line length of 91 exceeds 80 columns #523: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:475: + /* FIXME: bpf_assert_range(-MAX_ERRNO, 0) once we have it working for all cases. */ CHECK: spaces preferred around that '*' (ctx:WxV) #533: FILE: tools/testing/selftests/bpf/bpf_arena_spin_lock.h:485: +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 #567: 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 #567: FILE: tools/testing/selftests/bpf/bpf_atomic.h:1: +// SPDX-License-Identifier: GPL-2.0 WARNING: Prefer 'unsigned int' to bare use of 'unsigned' #594: FILE: tools/testing/selftests/bpf/bpf_atomic.h:28: + unsigned type : (unsigned type)0, signed type : (signed type)0 WARNING: Prefer 'signed int' to bare use of 'signed' #594: FILE: tools/testing/selftests/bpf/bpf_atomic.h:28: + unsigned type : (unsigned type)0, signed type : (signed type)0 ERROR: spaces required around that ':' (ctx:VxW) #598: FILE: tools/testing/selftests/bpf/bpf_atomic.h:32: + char: (char)0, \ ^ WARNING: labels should not be indented #598: FILE: tools/testing/selftests/bpf/bpf_atomic.h:32: + char: (char)0, \ ERROR: spaces required around that ':' (ctx:VxW) #604: FILE: tools/testing/selftests/bpf/bpf_atomic.h:38: + default: (typeof(x))0)) ^ ERROR: trailing statements should be on next line #604: FILE: tools/testing/selftests/bpf/bpf_atomic.h:38: + default: (typeof(x))0)) WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #609: FILE: tools/testing/selftests/bpf/bpf_atomic.h:43: +#define READ_ONCE(x) (*(volatile typeof(x) *)&(x)) WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #611: FILE: tools/testing/selftests/bpf/bpf_atomic.h:45: +#define WRITE_ONCE(x, val) ((*(volatile typeof(x) *)&(x)) = (val)) WARNING: memory barrier without comment #628: FILE: tools/testing/selftests/bpf/bpf_atomic.h:62: +#define smp_mb() \ WARNING: memory barrier without comment #634: FILE: tools/testing/selftests/bpf/bpf_atomic.h:68: +#define smp_rmb() \ WARNING: memory barrier without comment #637: FILE: tools/testing/selftests/bpf/bpf_atomic.h:71: + smp_mb(); \ WARNING: memory barrier without comment #642: FILE: tools/testing/selftests/bpf/bpf_atomic.h:76: +#define smp_wmb() \ WARNING: memory barrier without comment #645: FILE: tools/testing/selftests/bpf/bpf_atomic.h:79: + smp_mb(); \ WARNING: memory barrier without comment #653: FILE: tools/testing/selftests/bpf/bpf_atomic.h:87: +#define smp_load_acquire(p) \ WARNING: memory barrier without comment #657: FILE: tools/testing/selftests/bpf/bpf_atomic.h:91: + smp_mb(); \ WARNING: memory barrier without comment #662: FILE: tools/testing/selftests/bpf/bpf_atomic.h:96: +#define smp_store_release(p, val) \ WARNING: memory barrier without comment #665: FILE: tools/testing/selftests/bpf/bpf_atomic.h:99: + smp_mb(); \ CHECK: Macro argument 'p' may be better as '(p)' to avoid precedence issues #684: FILE: tools/testing/selftests/bpf/bpf_atomic.h:118: +#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, 652 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 c7458d0d1cf5 ("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.