From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by dpdk.org (Postfix, from userid 1017) id A30115F2F; Tue, 27 Feb 2018 10:37:35 +0100 (CET) In-Reply-To: <20180227093554.23951-7-qi.z.zhang@intel.com> References: <20180227093554.23951-7-qi.z.zhang@intel.com> To: test-report@dpdk.org Cc: Qi Zhang Message-Id: <20180227093735.A30115F2F@dpdk.org> Date: Tue, 27 Feb 2018 10:37:35 +0100 (CET) From: checkpatch@dpdk.org Subject: [dpdk-test-report] |WARNING| pw35449 [PATCH RFC 6/7] net/af_xdp: load BPF file X-BeenThere: test-report@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: automatic DPDK test reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 09:37:35 -0000 Test-Label: checkpatch Test-Status: WARNING http://dpdk.org/patch/35449 _coding style issues_ ERROR:GLOBAL_INITIALISERS: do not initialise globals to 0 #109: FILE: drivers/net/af_xdp/bpf_load.c:44: +int map_data_count = 0; CHECK:CAMELCASE: Avoid CamelCase: #328: FILE: drivers/net/af_xdp/bpf_load.c:263: +static int get_sec(Elf *elf, int i, GElf_Ehdr *ehdr, char **shname, CHECK:CAMELCASE: Avoid CamelCase: #328: FILE: drivers/net/af_xdp/bpf_load.c:263: +static int get_sec(Elf *elf, int i, GElf_Ehdr *ehdr, char **shname, CHECK:CAMELCASE: Avoid CamelCase: #329: FILE: drivers/net/af_xdp/bpf_load.c:264: + GElf_Shdr *shdr, Elf_Data **data) CHECK:CAMELCASE: Avoid CamelCase: #329: FILE: drivers/net/af_xdp/bpf_load.c:264: + GElf_Shdr *shdr, Elf_Data **data) CHECK:CAMELCASE: Avoid CamelCase: #331: FILE: drivers/net/af_xdp/bpf_load.c:266: + Elf_Scn *scn; CHECK:CAMELCASE: Avoid CamelCase: #360: FILE: drivers/net/af_xdp/bpf_load.c:295: + GElf_Sym sym; CHECK:CAMELCASE: Avoid CamelCase: #361: FILE: drivers/net/af_xdp/bpf_load.c:296: + GElf_Rel rel; CHECK:SPACING: spaces preferred around that '+' (ctx:VxV) #437: FILE: drivers/net/af_xdp/bpf_load.c:372: + sym = calloc(MAX_MAPS+1, sizeof(GElf_Sym)); ^ CHECK:SPACING: spaces preferred around that '+' (ctx:VxV) #439: FILE: drivers/net/af_xdp/bpf_load.c:374: + assert(nr_maps < MAX_MAPS+1); ^ CHECK:SPACING: No space is necessary after a cast #504: FILE: drivers/net/af_xdp/bpf_load.c:439: + addr = (unsigned char*) def + map_sz_copy; ERROR:POINTER_LOCATION: "(foo*)" should be "(foo *)" #504: FILE: drivers/net/af_xdp/bpf_load.c:439: + addr = (unsigned char*) def + map_sz_copy; CHECK:SPACING: No space is necessary after a cast #505: FILE: drivers/net/af_xdp/bpf_load.c:440: + end = (unsigned char*) def + map_sz_elf; ERROR:POINTER_LOCATION: "(foo*)" should be "(foo *)" #505: FILE: drivers/net/af_xdp/bpf_load.c:440: + end = (unsigned char*) def + map_sz_elf; CHECK:BRACES: Blank lines aren't necessary after an open brace '{' #554: FILE: drivers/net/af_xdp/bpf_load.c:489: + for (i = 1; i < ehdr.e_shnum; i++) { + CHECK:SPACING: No space is necessary after a cast #561: FILE: drivers/net/af_xdp/bpf_load.c:496: + shdr.sh_link, (int) shdr.sh_flags); CHECK:SPACING: No space is necessary after a cast #630: FILE: drivers/net/af_xdp/bpf_load.c:565: + insns = (struct bpf_insn *) data_prog->d_buf; CHECK:BRACES: Blank lines aren't necessary after an open brace '{' #641: FILE: drivers/net/af_xdp/bpf_load.c:576: + for (i = 1; i < ehdr.e_shnum; i++) { + CHECK:SPACING: No space is necessary after a cast #727: FILE: drivers/net/af_xdp/bpf_load.c:662: + syms[i].addr = (long) addr; ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses #1026: FILE: drivers/net/af_xdp/libbpf.h:86: +#define BPF_LD_IMM64_RAW(DST, SRC, IMM) \ + ((struct bpf_insn) { \ + .code = BPF_LD | BPF_DW | BPF_IMM, \ + .dst_reg = DST, \ + .src_reg = SRC, \ + .off = 0, \ + .imm = (__u32) (IMM) }), \ + ((struct bpf_insn) { \ + .code = 0, /* zero is reserved opcode */ \ + .dst_reg = 0, \ + .src_reg = 0, \ + .off = 0, \ + .imm = ((__u64) (IMM)) >> 32 }) CHECK:MACRO_ARG_REUSE: Macro argument reuse 'IMM' - possible side-effects? #1026: FILE: drivers/net/af_xdp/libbpf.h:86: +#define BPF_LD_IMM64_RAW(DST, SRC, IMM) \ + ((struct bpf_insn) { \ + .code = BPF_LD | BPF_DW | BPF_IMM, \ + .dst_reg = DST, \ + .src_reg = SRC, \ + .off = 0, \ + .imm = (__u32) (IMM) }), \ + ((struct bpf_insn) { \ + .code = 0, /* zero is reserved opcode */ \ + .dst_reg = 0, \ + .src_reg = 0, \ + .off = 0, \ + .imm = ((__u64) (IMM)) >> 32 }) CHECK:SPACING: No space is necessary after a cast #1032: FILE: drivers/net/af_xdp/libbpf.h:92: + .imm = (__u32) (IMM) }), \ CHECK:SPACING: No space is necessary after a cast #1038: FILE: drivers/net/af_xdp/libbpf.h:98: + .imm = ((__u64) (IMM)) >> 32 }) total: 4 errors, 0 warnings, 1157 lines checked