From: checkpatch@dpdk.org
To: test-report@dpdk.org
Cc: Qi Zhang <qi.z.zhang@intel.com>
Subject: [dpdk-test-report] |WARNING| pw35442 [PATCH RFC 6/7] net/af_xdp: load BPF file
Date: Tue, 27 Feb 2018 10:34:08 +0100 (CET) [thread overview]
Message-ID: <20180227093408.7A0895F22@dpdk.org> (raw)
In-Reply-To: <20180227093306.23854-7-qi.z.zhang@intel.com>
Test-Label: checkpatch
Test-Status: WARNING
http://dpdk.org/patch/35442
_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: <Elf>
#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: <GElf_Ehdr>
#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: <GElf_Shdr>
#329: FILE: drivers/net/af_xdp/bpf_load.c:264:
+ GElf_Shdr *shdr, Elf_Data **data)
CHECK:CAMELCASE: Avoid CamelCase: <Elf_Data>
#329: FILE: drivers/net/af_xdp/bpf_load.c:264:
+ GElf_Shdr *shdr, Elf_Data **data)
CHECK:CAMELCASE: Avoid CamelCase: <Elf_Scn>
#331: FILE: drivers/net/af_xdp/bpf_load.c:266:
+ Elf_Scn *scn;
CHECK:CAMELCASE: Avoid CamelCase: <GElf_Sym>
#360: FILE: drivers/net/af_xdp/bpf_load.c:295:
+ GElf_Sym sym;
CHECK:CAMELCASE: Avoid CamelCase: <GElf_Rel>
#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
parent reply other threads:[~2018-02-27 9:34 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20180227093306.23854-7-qi.z.zhang@intel.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180227093408.7A0895F22@dpdk.org \
--to=checkpatch@dpdk.org \
--cc=qi.z.zhang@intel.com \
--cc=test-report@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).