summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-08-14 22:27:04 -0700
committerSaul Wold <sgw@linux.intel.com>2017-08-15 14:03:06 -0700
commit2edb60c5f2aca1c2e23f2c532bbcf3413d68bafa (patch)
treeba54d07b3ab8af0082ba51ce7afe32f3e7396d26 /common
parentc0b5e0f3056a166bfcfe4e80611358d8d89280e7 (diff)
downloadmeta-intel-2edb60c5f2aca1c2e23f2c532bbcf3413d68bafa.tar.gz
dpdk-dev-libibverbs: Fix additional warnings
Clang detects more warnings as errors and these fixes address it Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'common')
-rw-r--r--common/recipes-extended/dpdk-dev-libibverbs/dpdk-dev-libibverbs_1.2.1-3.4-2.0.0.0.bb6
-rw-r--r--common/recipes-extended/dpdk-dev-libibverbs/files/0001-Fix-build-with-clang.patch32
-rw-r--r--common/recipes-extended/dpdk-dev-libibverbs/files/0002-typecast-enum-to-int-before-comparison.patch115
-rw-r--r--common/recipes-extended/dpdk-dev-libibverbs/files/0003-initialize-use_config_mr.patch31
-rw-r--r--common/recipes-extended/dpdk-dev-libibverbs/files/0004-Fix-clang-warnings.patch56
5 files changed, 239 insertions, 1 deletions
diff --git a/common/recipes-extended/dpdk-dev-libibverbs/dpdk-dev-libibverbs_1.2.1-3.4-2.0.0.0.bb b/common/recipes-extended/dpdk-dev-libibverbs/dpdk-dev-libibverbs_1.2.1-3.4-2.0.0.0.bb
index 5636d8fa..c06cceb7 100644
--- a/common/recipes-extended/dpdk-dev-libibverbs/dpdk-dev-libibverbs_1.2.1-3.4-2.0.0.0.bb
+++ b/common/recipes-extended/dpdk-dev-libibverbs/dpdk-dev-libibverbs_1.2.1-3.4-2.0.0.0.bb
@@ -5,7 +5,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=7c557f27dd795ba77cc419dddc656b51"
5 5
6SRC_URI = "https://github.com/Mellanox/dpdk-dev-libibverbs/archive/libibverbs-${PV}.tar.gz;name=${PN} \ 6SRC_URI = "https://github.com/Mellanox/dpdk-dev-libibverbs/archive/libibverbs-${PV}.tar.gz;name=${PN} \
7 file://init_c.patch \ 7 file://init_c.patch \
8 " 8 file://0001-Fix-build-with-clang.patch \
9 file://0002-typecast-enum-to-int-before-comparison.patch \
10 file://0003-initialize-use_config_mr.patch \
11 file://0004-Fix-clang-warnings.patch \
12 "
9 13
10SRC_URI[dpdk-dev-libibverbs.md5sum] = "65234ee278eb437a7069326f37cd4d86" 14SRC_URI[dpdk-dev-libibverbs.md5sum] = "65234ee278eb437a7069326f37cd4d86"
11SRC_URI[dpdk-dev-libibverbs.sha256sum] = "a6471515556cb8d10ad471bb7efb8cf760b248a28aceb57d4534d50d572f56cd" 15SRC_URI[dpdk-dev-libibverbs.sha256sum] = "a6471515556cb8d10ad471bb7efb8cf760b248a28aceb57d4534d50d572f56cd"
diff --git a/common/recipes-extended/dpdk-dev-libibverbs/files/0001-Fix-build-with-clang.patch b/common/recipes-extended/dpdk-dev-libibverbs/files/0001-Fix-build-with-clang.patch
new file mode 100644
index 00000000..93d8aba6
--- /dev/null
+++ b/common/recipes-extended/dpdk-dev-libibverbs/files/0001-Fix-build-with-clang.patch
@@ -0,0 +1,32 @@
1From b705caef6c717adc80585843b7fcc68700ced4b6 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 12 Aug 2017 09:25:24 -0700
4Subject: [PATCH 1/4] Fix build with clang
5
6Fix
7error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses]
8 if ((!port_attr->comp_mask & IBV_EXP_QUERY_PORT_ATTR_MASK1) ||
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12Upstream-Status: Pending
13
14 include/infiniband/verbs_exp.h | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/include/infiniband/verbs_exp.h b/include/infiniband/verbs_exp.h
18index ae94deb..42ed83d 100644
19--- a/include/infiniband/verbs_exp.h
20+++ b/include/infiniband/verbs_exp.h
21@@ -2955,7 +2955,7 @@ static inline int ibv_exp_query_port(struct ibv_context *context,
22 &port_attr->port_attr);
23
24 /* Check that only valid flags were given */
25- if ((!port_attr->comp_mask & IBV_EXP_QUERY_PORT_ATTR_MASK1) ||
26+ if (!(port_attr->comp_mask & IBV_EXP_QUERY_PORT_ATTR_MASK1) ||
27 (port_attr->comp_mask & ~IBV_EXP_QUERY_PORT_ATTR_MASKS) ||
28 (port_attr->mask1 & ~IBV_EXP_QUERY_PORT_MASK)) {
29 errno = EINVAL;
30--
312.14.1
32
diff --git a/common/recipes-extended/dpdk-dev-libibverbs/files/0002-typecast-enum-to-int-before-comparison.patch b/common/recipes-extended/dpdk-dev-libibverbs/files/0002-typecast-enum-to-int-before-comparison.patch
new file mode 100644
index 00000000..00516eba
--- /dev/null
+++ b/common/recipes-extended/dpdk-dev-libibverbs/files/0002-typecast-enum-to-int-before-comparison.patch
@@ -0,0 +1,115 @@
1From 7edab012f2d28de7e6d3657ec698e1090d0112de Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 12 Aug 2017 09:25:49 -0700
4Subject: [PATCH 2/4] typecast enum to int before comparison
5
6Fix
7error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare]
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11Upstream-Status: Pending
12
13 examples/cc_pingpong.c | 2 +-
14 examples/rc_pingpong.c | 2 +-
15 examples/srq_pingpong.c | 2 +-
16 examples/task_pingpong.c | 2 +-
17 examples/uc_pingpong.c | 2 +-
18 examples/umr_rc.c | 2 +-
19 examples/xsrq_pingpong.c | 2 +-
20 7 files changed, 7 insertions(+), 7 deletions(-)
21
22diff --git a/examples/cc_pingpong.c b/examples/cc_pingpong.c
23index 7b3e397..567c503 100644
24--- a/examples/cc_pingpong.c
25+++ b/examples/cc_pingpong.c
26@@ -1408,7 +1408,7 @@ int main(int argc, char *argv[])
27
28 case 'm':
29 mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
30- if (mtu < 0) {
31+ if ((int)mtu < 0) {
32 usage(argv[0]);
33 return 1;
34 }
35diff --git a/examples/rc_pingpong.c b/examples/rc_pingpong.c
36index 786577e..e661368 100644
37--- a/examples/rc_pingpong.c
38+++ b/examples/rc_pingpong.c
39@@ -759,7 +759,7 @@ int main(int argc, char *argv[])
40
41 case 'm':
42 mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
43- if (mtu < 0) {
44+ if ((int)mtu < 0) {
45 usage(argv[0]);
46 return 1;
47 }
48diff --git a/examples/srq_pingpong.c b/examples/srq_pingpong.c
49index 9762866..f85a7cd 100644
50--- a/examples/srq_pingpong.c
51+++ b/examples/srq_pingpong.c
52@@ -697,7 +697,7 @@ int main(int argc, char *argv[])
53
54 case 'm':
55 mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
56- if (mtu < 0) {
57+ if ((int)mtu < 0) {
58 usage(argv[0]);
59 return 1;
60 }
61diff --git a/examples/task_pingpong.c b/examples/task_pingpong.c
62index 748f8bb..d03a8b2 100644
63--- a/examples/task_pingpong.c
64+++ b/examples/task_pingpong.c
65@@ -1005,7 +1005,7 @@ int main(int argc, char *argv[])
66
67 case 'm':
68 mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
69- if (mtu < 0) {
70+ if ((int)mtu < 0) {
71 usage(argv[0]);
72 return 1;
73 }
74diff --git a/examples/uc_pingpong.c b/examples/uc_pingpong.c
75index 879bd77..a38a054 100644
76--- a/examples/uc_pingpong.c
77+++ b/examples/uc_pingpong.c
78@@ -606,7 +606,7 @@ int main(int argc, char *argv[])
79
80 case 'm':
81 mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
82- if (mtu < 0) {
83+ if ((int)mtu < 0) {
84 usage(argv[0]);
85 return 1;
86 }
87diff --git a/examples/umr_rc.c b/examples/umr_rc.c
88index ab76d3c..0ec636a 100644
89--- a/examples/umr_rc.c
90+++ b/examples/umr_rc.c
91@@ -950,7 +950,7 @@ int main(int argc, char *argv[])
92
93 case 'm':
94 mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
95- if (mtu < 0) {
96+ if ((int)mtu < 0) {
97 usage(argv[0]);
98 return 1;
99 }
100diff --git a/examples/xsrq_pingpong.c b/examples/xsrq_pingpong.c
101index c4ae51d..cebae5d 100644
102--- a/examples/xsrq_pingpong.c
103+++ b/examples/xsrq_pingpong.c
104@@ -910,7 +910,7 @@ int main(int argc, char *argv[])
105 break;
106 case 'm':
107 ctx.mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
108- if (ctx.mtu < 0) {
109+ if ((int)ctx.mtu < 0) {
110 usage(argv[0]);
111 return 1;
112 }
113--
1142.14.1
115
diff --git a/common/recipes-extended/dpdk-dev-libibverbs/files/0003-initialize-use_config_mr.patch b/common/recipes-extended/dpdk-dev-libibverbs/files/0003-initialize-use_config_mr.patch
new file mode 100644
index 00000000..da4ef15b
--- /dev/null
+++ b/common/recipes-extended/dpdk-dev-libibverbs/files/0003-initialize-use_config_mr.patch
@@ -0,0 +1,31 @@
1From 936da7fcab06ff3bc7c1c1e1ab108a36797da039 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 12 Aug 2017 09:28:00 -0700
4Subject: [PATCH 3/4] initialize use_config_mr
5
6Fixes
7error: variable 'use_contig_mr' is uninitialized when used here [-Werror,-Wuninitialized]
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11Upstream-Status: Pending
12
13 examples/dcini.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/examples/dcini.c b/examples/dcini.c
17index 001e905..08d75ec 100644
18--- a/examples/dcini.c
19+++ b/examples/dcini.c
20@@ -269,7 +269,7 @@ int main(int argc, char *argv[])
21 int size = 4096;
22 int iters = 1000;
23 int use_event = 0;
24- int use_contig_mr;
25+ int use_contig_mr = 0;
26 int err;
27 struct ibv_ah_attr ah_attr;
28 struct dc_ctx ctx = {
29--
302.14.1
31
diff --git a/common/recipes-extended/dpdk-dev-libibverbs/files/0004-Fix-clang-warnings.patch b/common/recipes-extended/dpdk-dev-libibverbs/files/0004-Fix-clang-warnings.patch
new file mode 100644
index 00000000..26f09e54
--- /dev/null
+++ b/common/recipes-extended/dpdk-dev-libibverbs/files/0004-Fix-clang-warnings.patch
@@ -0,0 +1,56 @@
1From 08944074f9d9525a57e88a4990dd833d0999b8df Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 12 Aug 2017 09:36:55 -0700
4Subject: [PATCH 4/4] Fix clang warnings
5
6../../../../../../../workspace/sources/dpdk-dev-libibverbs/examples/intf.c:1221:11: error: comparison of array 'ctx->dev_name' not equal to a null pointer is always true [-Werror,-Wtautological-pointer-compare]
7 if (ctx->dev_name != NULL) {
8 ~~~~~^~~~~~~~ ~~~~
9../../../../../../../workspace/sources/dpdk-dev-libibverbs/examples/intf.c:1893:13: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
10 if (size < 0 || size > MAX_MSG_SIZE)
11 ~~~~ ^ ~
12../../../../../../../workspace/sources/dpdk-dev-libibverbs/examples/intf.c:1901:12: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare]
13 if (mtu < 0)
14 ~~~ ^ ~
15
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18Upstream-Status: Pending
19
20 examples/intf.c | 6 +++---
21 1 file changed, 3 insertions(+), 3 deletions(-)
22
23diff --git a/examples/intf.c b/examples/intf.c
24index 8d158ee..1f1af50 100644
25--- a/examples/intf.c
26+++ b/examples/intf.c
27@@ -1218,7 +1218,7 @@ int create_resources(struct intf_context *ctx)
28 return 1;
29 }
30
31- if (!ctx->dev_name) {
32+ if (!ctx->dev_name[0]) {
33 ctx->ib_dev = *dev_list;
34 if (!ctx->ib_dev) {
35 fprintf(stderr, "No IB devices found\n");
36@@ -1828,7 +1828,7 @@ int parse_input(struct intf_input *input, struct intf_input *default_input, int
37 char *ib_devname = NULL;
38 char *vrbs_intf = NULL;
39 char *cpus_str = NULL;
40- unsigned long long size;
41+ long long size;
42
43 memcpy(input, default_input, sizeof(*input));
44
45@@ -1898,7 +1898,7 @@ int parse_input(struct intf_input *input, struct intf_input *default_input, int
46
47 case 'm':
48 mtu = mtu_to_enum(strtol(optarg, NULL, 0));
49- if (mtu < 0)
50+ if ((int)mtu < 0)
51 goto print_usage;
52 input->ib_data.mtu = mtu;
53 break;
54--
552.14.1
56