CHECK: Prefer kernel type 'u32' over 'uint32_t' #73: FILE: kernel/kexec_pe_image.c:65: + uint32_t size; // Size of decompressed data CHECK: Prefer using the BIT macro #77: FILE: kernel/kexec_pe_image.c:69: +#define MAX_KEXEC_RES_SIZE (1 << 29) CHECK: Blank lines aren't necessary after an open brace '{' #98: FILE: kernel/kexec_pe_image.c:90: +{ + CHECK: Please don't use multiple blank lines #103: FILE: kernel/kexec_pe_image.c:95: + + CHECK: Comparison to NULL could be written "!res->name" #135: FILE: kernel/kexec_pe_image.c:127: + if (res->name == NULL) { WARNING: line length of 101 exceeds 80 columns #136: FILE: kernel/kexec_pe_image.c:128: + pr_err("Invalid resource name: %s, should be 'kernel', 'initrd', 'cmdline'\n", name); WARNING: line length of 98 exceeds 80 columns #159: FILE: kernel/kexec_pe_image.c:151: +__bpf_kfunc struct mem_range_result *bpf_kexec_decompress(char *image_gz_payload, int image_gz_sz, CHECK: Alignment should match open parenthesis #160: FILE: kernel/kexec_pe_image.c:152: +__bpf_kfunc struct mem_range_result *bpf_kexec_decompress(char *image_gz_payload, int image_gz_sz, + unsigned int expected_decompressed_sz) WARNING: Possible unnecessary 'out of memory' message #173: FILE: kernel/kexec_pe_image.c:165: + if (!range) { + pr_err("fail to allocate mem_range_result\n"); WARNING: Possible unnecessary 'out of memory' message #180: FILE: kernel/kexec_pe_image.c:172: + if (!input_buf) { + pr_err("fail to allocate input buffer\n"); WARNING: line length of 81 exceeds 80 columns #185: FILE: kernel/kexec_pe_image.c:177: + ret = copy_from_kernel_nofault(input_buf, image_gz_payload, image_gz_sz); WARNING: Using vsprintf specifier '%px' potentially exposes the kernel memory layout, if you don't really need the address please consider using '%p'. #187: FILE: kernel/kexec_pe_image.c:179: + pr_err("Error when copying from 0x%px, size:0x%x\n", + image_gz_payload, image_gz_sz); CHECK: Alignment should match open parenthesis #188: FILE: kernel/kexec_pe_image.c:180: + pr_err("Error when copying from 0x%px, size:0x%x\n", + image_gz_payload, image_gz_sz); WARNING: Possible unnecessary 'out of memory' message #196: FILE: kernel/kexec_pe_image.c:188: + if (!output_buf) { + pr_err("fail to allocate output buffer\n"); CHECK: Alignment should match open parenthesis #212: FILE: kernel/kexec_pe_image.c:204: + ret = decompressor(image_gz_payload, image_gz_sz, NULL, NULL, + output_buf, NULL, NULL); WARNING: line length of 81 exceeds 80 columns #258: FILE: kernel/kexec_pe_image.c:527: + ret = register_btf_kfunc_id_set(BPF_PROG_TYPE_TRACING, &kexec_kfunc_set); total: 0 errors, 8 warnings, 8 checks, 209 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 968f0ba4cca2 ("bpf/kexec: Introduce three bpf kfunc for kexec") 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, 8 warnings, 8 checks, 209 lines checked