Hi kunyu, kernel test robot noticed the following build errors: [auto build test ERROR on bpf-next/master] [also build test ERROR on bpf/master net-next/main net/main linus/master v6.10-rc3 next-20240612] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/kunyu/x86-net-bpf_jit_comp32-Remove-unused-cnt-variables-from-most-functions/20240612-170017 base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master patch link: https://lore.kernel.org/r/20240612085823.28133-1-kunyu%40nfschina.com patch subject: [PATCH] x86: net: bpf_jit_comp32: Remove unused 'cnt' variables from most functions config: i386-buildonly-randconfig-004-20240613 (https://download.01.org/0day-ci/archive/20240613/202406130900.iANs9YtU-lkp@xxxxxxxxx/config) compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240613/202406130900.iANs9YtU-lkp@xxxxxxxxx/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202406130900.iANs9YtU-lkp@xxxxxxxxx/ All errors (new ones prefixed by >>): >> arch/x86/net/bpf_jit_comp32.c:214:4: error: use of undeclared identifier 'cnt' 214 | EMIT2(0x33, add_2reg(0xC0, IA32_EAX, IA32_EAX)); | ^ arch/x86/net/bpf_jit_comp32.c:68:24: note: expanded from macro 'EMIT2' 68 | #define EMIT2(b1, b2) EMIT((b1) + ((b2) << 8), 2) | ^ arch/x86/net/bpf_jit_comp32.c:65:43: note: expanded from macro 'EMIT' 65 | do { prog = emit_code(prog, bytes, len); cnt += len; } while (0) | ^ arch/x86/net/bpf_jit_comp32.c:216:4: error: use of undeclared identifier 'cnt' 216 | EMIT3(0x89, add_2reg(0x40, IA32_EBP, IA32_EAX), | ^ arch/x86/net/bpf_jit_comp32.c:69:27: note: expanded from macro 'EMIT3' 69 | #define EMIT3(b1, b2, b3) EMIT((b1) + ((b2) << 8) + ((b3) << 16), 3) | ^ arch/x86/net/bpf_jit_comp32.c:65:43: note: expanded from macro 'EMIT' 65 | do { prog = emit_code(prog, bytes, len); cnt += len; } while (0) | ^ arch/x86/net/bpf_jit_comp32.c:219:4: error: use of undeclared identifier 'cnt' 219 | EMIT3_off32(0xC7, add_1reg(0x40, IA32_EBP), | ^ arch/x86/net/bpf_jit_comp32.c:78:7: note: expanded from macro 'EMIT3_off32' 78 | do { EMIT3(b1, b2, b3); EMIT(off, 4); } while (0) | ^ arch/x86/net/bpf_jit_comp32.c:69:27: note: expanded from macro 'EMIT3' 69 | #define EMIT3(b1, b2, b3) EMIT((b1) + ((b2) << 8) + ((b3) << 16), 3) | ^ arch/x86/net/bpf_jit_comp32.c:65:43: note: expanded from macro 'EMIT' 65 | do { prog = emit_code(prog, bytes, len); cnt += len; } while (0) | ^ arch/x86/net/bpf_jit_comp32.c:219:4: error: use of undeclared identifier 'cnt' arch/x86/net/bpf_jit_comp32.c:78:26: note: expanded from macro 'EMIT3_off32' 78 | do { EMIT3(b1, b2, b3); EMIT(off, 4); } while (0) | ^ arch/x86/net/bpf_jit_comp32.c:65:43: note: expanded from macro 'EMIT' 65 | do { prog = emit_code(prog, bytes, len); cnt += len; } while (0) | ^ arch/x86/net/bpf_jit_comp32.c:224:4: error: use of undeclared identifier 'cnt' 224 | EMIT2(0x33, add_2reg(0xC0, dst, dst)); | ^ arch/x86/net/bpf_jit_comp32.c:68:24: note: expanded from macro 'EMIT2' 68 | #define EMIT2(b1, b2) EMIT((b1) + ((b2) << 8), 2) | ^ arch/x86/net/bpf_jit_comp32.c:65:43: note: expanded from macro 'EMIT' 65 | do { prog = emit_code(prog, bytes, len); cnt += len; } while (0) | ^ arch/x86/net/bpf_jit_comp32.c:226:4: error: use of undeclared identifier 'cnt' 226 | EMIT2_off32(0xC7, add_1reg(0xC0, dst), | ^ arch/x86/net/bpf_jit_comp32.c:76:7: note: expanded from macro 'EMIT2_off32' 76 | do { EMIT2(b1, b2); EMIT(off, 4); } while (0) | ^ arch/x86/net/bpf_jit_comp32.c:68:24: note: expanded from macro 'EMIT2' 68 | #define EMIT2(b1, b2) EMIT((b1) + ((b2) << 8), 2) | ^ arch/x86/net/bpf_jit_comp32.c:65:43: note: expanded from macro 'EMIT' 65 | do { prog = emit_code(prog, bytes, len); cnt += len; } while (0) | ^ arch/x86/net/bpf_jit_comp32.c:226:4: error: use of undeclared identifier 'cnt' arch/x86/net/bpf_jit_comp32.c:76:22: note: expanded from macro 'EMIT2_off32' 76 | do { EMIT2(b1, b2); EMIT(off, 4); } while (0) | ^ arch/x86/net/bpf_jit_comp32.c:65:43: note: expanded from macro 'EMIT' 65 | do { prog = emit_code(prog, bytes, len); cnt += len; } while (0) | ^ arch/x86/net/bpf_jit_comp32.c:241:3: error: use of undeclared identifier 'cnt' 241 | EMIT3(0x8B, add_2reg(0x40, IA32_EBP, IA32_EAX), STACK_VAR(src)); | ^ arch/x86/net/bpf_jit_comp32.c:69:27: note: expanded from macro 'EMIT3' 69 | #define EMIT3(b1, b2, b3) EMIT((b1) + ((b2) << 8) + ((b3) << 16), 3) | ^ arch/x86/net/bpf_jit_comp32.c:65:43: note: expanded from macro 'EMIT' 65 | do { prog = emit_code(prog, bytes, len); cnt += len; } while (0) | ^ arch/x86/net/bpf_jit_comp32.c:244:3: error: use of undeclared identifier 'cnt' 244 | EMIT3(0x89, add_2reg(0x40, IA32_EBP, sreg), STACK_VAR(dst)); | ^ arch/x86/net/bpf_jit_comp32.c:69:27: note: expanded from macro 'EMIT3' 69 | #define EMIT3(b1, b2, b3) EMIT((b1) + ((b2) << 8) + ((b3) << 16), 3) | ^ arch/x86/net/bpf_jit_comp32.c:65:43: note: expanded from macro 'EMIT' 65 | do { prog = emit_code(prog, bytes, len); cnt += len; } while (0) | ^ arch/x86/net/bpf_jit_comp32.c:247:3: error: use of undeclared identifier 'cnt' 247 | EMIT2(0x89, add_2reg(0xC0, dst, sreg)); | ^ arch/x86/net/bpf_jit_comp32.c:68:24: note: expanded from macro 'EMIT2' 68 | #define EMIT2(b1, b2) EMIT((b1) + ((b2) << 8), 2) | ^ arch/x86/net/bpf_jit_comp32.c:65:43: note: expanded from macro 'EMIT' 65 | do { prog = emit_code(prog, bytes, len); cnt += len; } while (0) | ^ arch/x86/net/bpf_jit_comp32.c:291:3: error: use of undeclared identifier 'cnt' 291 | EMIT3(0x8B, add_2reg(0x40, IA32_EBP, IA32_ECX), STACK_VAR(src)); | ^ arch/x86/net/bpf_jit_comp32.c:69:27: note: expanded from macro 'EMIT3' 69 | #define EMIT3(b1, b2, b3) EMIT((b1) + ((b2) << 8) + ((b3) << 16), 3) | ^ arch/x86/net/bpf_jit_comp32.c:65:43: note: expanded from macro 'EMIT' 65 | do { prog = emit_code(prog, bytes, len); cnt += len; } while (0) | ^ vim +/cnt +214 arch/x86/net/bpf_jit_comp32.c 03f5781be2c7b7 Wang YanQing 2018-05-03 205 03f5781be2c7b7 Wang YanQing 2018-05-03 206 static inline void emit_ia32_mov_i(const u8 dst, const u32 val, bool dstk, 03f5781be2c7b7 Wang YanQing 2018-05-03 207 u8 **pprog) 03f5781be2c7b7 Wang YanQing 2018-05-03 208 { 03f5781be2c7b7 Wang YanQing 2018-05-03 209 u8 *prog = *pprog; 03f5781be2c7b7 Wang YanQing 2018-05-03 210 03f5781be2c7b7 Wang YanQing 2018-05-03 211 if (dstk) { 03f5781be2c7b7 Wang YanQing 2018-05-03 212 if (val == 0) { 03f5781be2c7b7 Wang YanQing 2018-05-03 213 /* xor eax,eax */ 03f5781be2c7b7 Wang YanQing 2018-05-03 @214 EMIT2(0x33, add_2reg(0xC0, IA32_EAX, IA32_EAX)); 03f5781be2c7b7 Wang YanQing 2018-05-03 215 /* mov dword ptr [ebp+off],eax */ 03f5781be2c7b7 Wang YanQing 2018-05-03 216 EMIT3(0x89, add_2reg(0x40, IA32_EBP, IA32_EAX), 03f5781be2c7b7 Wang YanQing 2018-05-03 217 STACK_VAR(dst)); 03f5781be2c7b7 Wang YanQing 2018-05-03 218 } else { 03f5781be2c7b7 Wang YanQing 2018-05-03 219 EMIT3_off32(0xC7, add_1reg(0x40, IA32_EBP), 03f5781be2c7b7 Wang YanQing 2018-05-03 220 STACK_VAR(dst), val); 03f5781be2c7b7 Wang YanQing 2018-05-03 221 } 03f5781be2c7b7 Wang YanQing 2018-05-03 222 } else { 03f5781be2c7b7 Wang YanQing 2018-05-03 223 if (val == 0) 03f5781be2c7b7 Wang YanQing 2018-05-03 224 EMIT2(0x33, add_2reg(0xC0, dst, dst)); 03f5781be2c7b7 Wang YanQing 2018-05-03 225 else 03f5781be2c7b7 Wang YanQing 2018-05-03 226 EMIT2_off32(0xC7, add_1reg(0xC0, dst), 03f5781be2c7b7 Wang YanQing 2018-05-03 227 val); 03f5781be2c7b7 Wang YanQing 2018-05-03 228 } 03f5781be2c7b7 Wang YanQing 2018-05-03 229 *pprog = prog; 03f5781be2c7b7 Wang YanQing 2018-05-03 230 } 03f5781be2c7b7 Wang YanQing 2018-05-03 231 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki