WARNING: Improper SPDX comment style for 'tools/testing/selftests/bpf/libarena/include/buddy.h', please use '/*' instead #28: FILE: tools/testing/selftests/bpf/libarena/include/buddy.h:1: +// SPDX-License-Identifier: LGPL-2.1 OR BSD-2-Clause WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #28: FILE: tools/testing/selftests/bpf/libarena/include/buddy.h:1: +// SPDX-License-Identifier: LGPL-2.1 OR BSD-2-Clause WARNING: do not add new typedefs #33: FILE: tools/testing/selftests/bpf/libarena/include/buddy.h:6: +typedef struct buddy_chunk __arena buddy_chunk_t; WARNING: do not add new typedefs #36: FILE: tools/testing/selftests/bpf/libarena/include/buddy.h:9: +typedef struct buddy_header __arena buddy_header_t; WARNING: line length of 84 exceeds 80 columns #59: FILE: tools/testing/selftests/bpf/libarena/include/buddy.h:32: + BUDDY_CHUNK_BYTES = BUDDY_MIN_ALLOC_BYTES << (BUDDY_CHUNK_NUM_ORDERS), WARNING: line length of 90 exceeds 80 columns #61: FILE: tools/testing/selftests/bpf/libarena/include/buddy.h:34: + /* Offset off the buddy header within a free block, see buddy.bpf.c for details */ WARNING: line length of 94 exceeds 80 columns #81: FILE: tools/testing/selftests/bpf/libarena/include/buddy.h:54: + u32 prev_index; /* "Pointer" to the previous available allocation of the same size. */ WARNING: line length of 87 exceeds 80 columns #102: FILE: tools/testing/selftests/bpf/libarena/include/buddy.h:75: + buddy_chunk_t *first_chunk; /* Pointer to the chunk linked list. */ WARNING: line length of 84 exceeds 80 columns #104: FILE: tools/testing/selftests/bpf/libarena/include/buddy.h:77: + u64 vaddr; /* Allocation into reserved vaddr */ WARNING: do not add new typedefs #107: FILE: tools/testing/selftests/bpf/libarena/include/buddy.h:80: +typedef struct buddy __arena buddy_t; WARNING: line length of 88 exceeds 80 columns #116: FILE: tools/testing/selftests/bpf/libarena/include/buddy.h:89: +#define buddy_alloc(alloc, size) ((void __arena *)buddy_alloc_internal((alloc), (size))) CHECK: Please don't use multiple blank lines #118: FILE: tools/testing/selftests/bpf/libarena/include/buddy.h:91: + + CHECK: Please don't use multiple blank lines #165: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:40: + + CHECK: Lines should not end with a '(' #203: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:78: + bpf_arena_free_pages( CHECK: spaces preferred around that '*' (ctx:WxV) #222: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:97: +__weak int buddy_alloc_arena_vaddr(buddy_t __arg_arena *buddy, u64 *vaddrp) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #262: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:137: +int idx_set_allocated(buddy_chunk_t __arg_arena *chunk, u64 idx, bool allocated) ^ WARNING: line length of 82 exceeds 80 columns #281: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:156: + arena_stderr("getting state of invalid idx (%llu, max %d)\n", idx, CHECK: spaces preferred around that '*' (ctx:WxV) #291: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:166: +int idx_set_order(buddy_chunk_t __arg_arena *chunk, u64 idx, u8 order) ^ WARNING: line length of 81 exceeds 80 columns #383: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:258: + * to the header because of off-by-one errors when using adjacent blocks. WARNING: line length of 81 exceeds 80 columns #390: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:265: + * As a result, we have only two possible positions for the header: Bytes WARNING: line length of 84 exceeds 80 columns #391: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:266: + * 0 and 8. Keeping the header in byte 0 means off-by-ones from the previous WARNING: line length of 81 exceeds 80 columns #392: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:267: + * block touch the header, and, since the header must be accessible, ASAN WARNING: line length of 86 exceeds 80 columns #393: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:268: + * will not trigger. Keeping the header on byte 8 means off-by-one errors from WARNING: line length of 83 exceeds 80 columns #395: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:270: + * while accesses into the block from the next block are possible, they are CHECK: Alignment should match open parenthesis #403: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:278: +static void header_add_freelist(buddy_chunk_t *chunk, buddy_header_t *header, + u64 idx, u8 order) CHECK: spaces preferred around that '*' (ctx:WxV) #472: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:347: +int add_leftovers_to_freelist(buddy_chunk_t __arg_arena *chunk, u32 cur_idx, ^ CHECK: Alignment should match open parenthesis #473: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:348: +int add_leftovers_to_freelist(buddy_chunk_t __arg_arena *chunk, u32 cur_idx, + u64 min_order, u64 max_order) WARNING: line length of 82 exceeds 80 columns #537: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:412: + * accidental deadlocks that will cause -ENOMEMs to the program as WARNING: line length of 82 exceeds 80 columns #538: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:413: + * the allocator fails to refill itself, in which case vaddr usage WARNING: line length of 87 exceeds 80 columns #541: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:416: + bpf_arena_free_pages(&arena, (void __arena *)vaddr, BUDDY_CHUNK_PAGES); WARNING: line length of 85 exceeds 80 columns #581: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:456: + * - Find the largest power-of-2 allocation still smaller than left (infimum) WARNING: please, no space before tabs #595: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:470: +^I * ^I[0, 64) - Completely allocated$ WARNING: please, no space before tabs #596: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:471: +^I * ^I[64, 128) - Will be further split in the next iteration$ WARNING: please, no space before tabs #599: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:474: +^I * ^I[128, 256)$ WARNING: please, no space before tabs #600: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:475: +^I * ^I[256, 512)$ WARNING: please, no space before tabs #601: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:476: +^I * ^I...$ WARNING: please, no space before tabs #602: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:477: +^I * ^I[1 << 18, 1 << 19)$ WARNING: please, no space before tabs #603: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:478: +^I * ^I[1 << 19, 1 << 20)$ WARNING: please, no space before tabs #608: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:483: +^I * 64^I 80^I96^I^I ^I64 + 1 << 6 = 128$ WARNING: please, no space before tabs #612: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:487: +^I * ^I[64, 80)^I- Completely allocated$ WARNING: please, no space before tabs #616: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:491: +^I * ^I[96, 128)$ CHECK: Lines should not end with a '(' #631: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:506: + arena_stderr( CHECK: Lines should not end with a '(' #634: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:509: + arena_stderr( WARNING: line length of 95 exceeds 80 columns #645: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:520: + order = (power2 >= BUDDY_MIN_ALLOC_SHIFT) ? power2 - BUDDY_MIN_ALLOC_SHIFT : 0; WARNING: line length of 81 exceeds 80 columns #656: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:531: + * states by emitting a diagnostic in add_leftovers_to_freelist() WARNING: line length of 82 exceeds 80 columns #660: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:535: + if (add_leftovers_to_freelist(chunk, idx, min_order, max_order)) { CHECK: spaces preferred around that '*' (ctx:WxV) #675: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:550: +__weak int buddy_init(buddy_t __arg_arena *buddy) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #716: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:591: +__weak int buddy_destroy(buddy_t __arg_arena *buddy) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #745: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:620: +__weak u64 buddy_chunk_alloc(buddy_chunk_t __arg_arena *chunk, int order_req) ^ WARNING: line length of 86 exceeds 80 columns #753: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:628: + for (order = order_req; order < BUDDY_CHUNK_NUM_ORDERS && can_loop; order++) { CHECK: Comparison to NULL could be written "chunk" #825: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:700: + for (chunk = buddy->first_chunk; chunk != NULL && can_loop; WARNING: line length of 86 exceeds 80 columns #839: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:714: +static u64 buddy_alloc_from_new_chunk(buddy_t *buddy, buddy_chunk_t *chunk, int order) CHECK: Please don't use multiple blank lines #846: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:721: + + CHECK: Please use a blank line after function/struct/union/enum declarations #860: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:735: +} +__weak CHECK: spaces preferred around that '*' (ctx:WxV) #861: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:736: +u64 buddy_alloc_internal(buddy_t __arg_arena *buddy, size_t size) ^ WARNING: line length of 86 exceeds 80 columns #962: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:837: + /* Keep the left header out of the two buddies, drop the other one. */ WARNING: line length of 82 exceeds 80 columns #969: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:844: + /* Remove the buddy from the freelists so that we can merge it. */ CHECK: spaces preferred around that '*' (ctx:WxV) #986: FILE: tools/testing/selftests/bpf/libarena/src/buddy.bpf.c:861: +__weak int buddy_free_internal(buddy_t __arg_arena *buddy, u64 addr) ^ total: 0 errors, 39 warnings, 19 checks, 996 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 b78fa27f8e30 ("selftests/bpf: Add buddy allocator for libarena") 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, 39 warnings, 19 checks, 996 lines checked