WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #67: new file mode 100644 CHECK: spaces preferred around that '-' (ctx:VxV) #95: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:24: +#define __round_mask(x, y) ((__typeof__(x))((y)-1)) ^ CHECK: spaces preferred around that '-' (ctx:VxV) #98: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:27: +#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) ^ CHECK: spaces preferred around that '+' (ctx:VxV) #98: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:27: +#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) ^ WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #102: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:31: +#define READ_ONCE(x) (*(volatile typeof(x) *)&(x)) WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #106: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:35: +#define WRITE_ONCE(x, val) ((*(volatile typeof(x) *)&(x)) = (val)) WARNING: do not add new typedefs #113: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:42: +typedef struct { WARNING: Prefer __weak over __attribute__((weak)) #137: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:66: +struct u_tld_metadata *tld_metadata_p __attribute__((weak)); WARNING: Prefer __weak over __attribute__((weak)) #138: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:67: +__thread struct u_tld_data *tld_data_p __attribute__((weak)); WARNING: line length of 81 exceeds 80 columns #224: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:153: + * Returns an opaque object key. Use tld_key_is_err() or tld_key_err_or_zero() to WARNING: __always_unused or __maybe_unused is preferred over __attribute__((__unused__)) #228: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:157: +__attribute__((unused)) WARNING: line length of 91 exceeds 80 columns #252: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:181: + * Pending tld_create_key() uses size to signal if the metadata has WARNING: line length of 88 exceeds 80 columns #255: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:184: + while (!(sz = __atomic_load_n(&tld_metadata_p->metadata[i].size, WARNING: line length of 91 exceeds 80 columns #259: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:188: + if (!strncmp(tld_metadata_p->metadata[i].name, name, TLD_NAME_LEN)) WARNING: line length of 84 exceeds 80 columns #270: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:199: + * Only one tld_create_key() can increase the current cnt by one and WARNING: line length of 91 exceeds 80 columns #271: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:200: + * takes the latest available slot. Other threads will check again if a new WARNING: line length of 86 exceeds 80 columns #272: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:201: + * TLD can still be added, and then compete for the new slot after the WARNING: line length of 91 exceeds 80 columns #275: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:204: + if (!__atomic_compare_exchange_n(&tld_metadata_p->cnt, &cnt, cnt + 1, true, WARNING: line length of 85 exceeds 80 columns #276: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:205: + __ATOMIC_RELAXED, __ATOMIC_RELAXED)) WARNING: Prefer strscpy, strscpy_pad, or __nonstring over strncpy - see: https://github.com/KSPP/linux/issues/90 #279: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:208: + strncpy(tld_metadata_p->metadata[i].name, name, TLD_NAME_LEN); WARNING: line length of 92 exceeds 80 columns #280: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:209: + __atomic_store_n(&tld_metadata_p->metadata[i].size, size, __ATOMIC_RELEASE); WARNING: __always_unused or __maybe_unused is preferred over __attribute__((__unused__)) #287: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:216: +__attribute__((unused)) WARNING: __always_unused or __maybe_unused is preferred over __attribute__((__unused__)) #293: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:222: +__attribute__((unused)) WARNING: __always_unused or __maybe_unused is preferred over __attribute__((__unused__)) #312: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:241: +__attribute__((unused)) WARNING: __always_unused or __maybe_unused is preferred over __attribute__((__unused__)) #327: FILE: tools/testing/selftests/bpf/prog_tests/task_local_data.h:256: +__attribute__((unused)) WARNING: line length of 83 exceeds 80 columns #396: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:56: + * It should be declared as a stack variable and initialized via tld_object_init(). WARNING: do not add new typedefs #414: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:74: +typedef struct { CHECK: spaces preferred around that '*' (ctx:WxV) #437: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:97: + struct u_tld_data __uptr *data; ^ CHECK: spaces preferred around that '*' (ctx:WxV) #438: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:98: + struct u_tld_metadata __uptr *metadata; ^ WARNING: line length of 81 exceeds 80 columns #448: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:108: + * Members should be tld_key_t and passed to the 3rd argument of tld_fetch_key(). WARNING: line length of 81 exceeds 80 columns #472: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:132: + * Returns 0 on success; -ENODATA if the task has no TLD; -ENOMEM if the creation WARNING: __always_unused or __maybe_unused is preferred over __attribute__((__unused__)) #475: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:135: +__attribute__((unused)) WARNING: line length of 81 exceeds 80 columns #500: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:160: +#define tld_fetch_key(tld_obj, name, key) \ CHECK: Macro argument 'key' may be better as '(key)' to avoid precedence issues #500: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:160: +#define tld_fetch_key(tld_obj, name, key) \ + ({ \ + (tld_obj)->key_map->key.off = __tld_fetch_key(tld_obj, name); \ + }) WARNING: line length of 81 exceeds 80 columns #501: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:161: + ({ \ WARNING: line length of 81 exceeds 80 columns #502: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:162: + (tld_obj)->key_map->key.off = __tld_fetch_key(tld_obj, name); \ WARNING: __always_unused or __maybe_unused is preferred over __attribute__((__unused__)) #505: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:165: +__attribute__((unused)) WARNING: line length of 88 exceeds 80 columns #520: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:180: + if (meta_off > TLD_DATA_SIZE - offsetof(struct u_tld_metadata, metadata) WARNING: line length of 87 exceeds 80 columns #528: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:188: + * Reserve 0 for uninitialized keys. Increase the offset of a valid key CHECK: Macro argument 'key' may be better as '(key)' to avoid precedence issues #550: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:210: +#define tld_get_data(tld_obj, key, size) \ + __tld_get_data(tld_obj, (tld_obj)->key_map->key.off - 1, size) WARNING: __always_unused or __maybe_unused is preferred over __attribute__((__unused__)) #553: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:213: +__attribute__((unused)) WARNING: line length of 83 exceeds 80 columns #554: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:214: +__always_inline void *__tld_get_data(struct tld_object *tld_obj, u32 off, u32 size) WARNING: line length of 84 exceeds 80 columns #556: FILE: tools/testing/selftests/bpf/progs/task_local_data.bpf.h:216: + return (tld_obj->data_map->data && off >= 0 && off < TLD_DATA_SIZE - size) ? total: 0 errors, 36 warnings, 7 checks, 483 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 03d432f937f1 ("selftests/bpf: Introduce task local data") 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. total: 0 errors, 36 warnings, 7 checks, 483 lines checked