aboutsummaryrefslogtreecommitdiffstats
path: root/meta-dpdk/recipes-extended/dpdk-dev-libibverbs/files/0002-typecast-enum-to-int-before-comparison.patch
blob: 00516eba8a86cf44cd2d098b08306672df49382c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
From 7edab012f2d28de7e6d3657ec698e1090d0112de Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 12 Aug 2017 09:25:49 -0700
Subject: [PATCH 2/4] typecast enum to int before comparison

Fix
error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending

 examples/cc_pingpong.c   | 2 +-
 examples/rc_pingpong.c   | 2 +-
 examples/srq_pingpong.c  | 2 +-
 examples/task_pingpong.c | 2 +-
 examples/uc_pingpong.c   | 2 +-
 examples/umr_rc.c        | 2 +-
 examples/xsrq_pingpong.c | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/examples/cc_pingpong.c b/examples/cc_pingpong.c
index 7b3e397..567c503 100644
--- a/examples/cc_pingpong.c
+++ b/examples/cc_pingpong.c
@@ -1408,7 +1408,7 @@ int main(int argc, char *argv[])
 
 		case 'm':
 			mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
-			if (mtu < 0) {
+			if ((int)mtu < 0) {
 				usage(argv[0]);
 				return 1;
 			}
diff --git a/examples/rc_pingpong.c b/examples/rc_pingpong.c
index 786577e..e661368 100644
--- a/examples/rc_pingpong.c
+++ b/examples/rc_pingpong.c
@@ -759,7 +759,7 @@ int main(int argc, char *argv[])
 
 		case 'm':
 			mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
-			if (mtu < 0) {
+			if ((int)mtu < 0) {
 				usage(argv[0]);
 				return 1;
 			}
diff --git a/examples/srq_pingpong.c b/examples/srq_pingpong.c
index 9762866..f85a7cd 100644
--- a/examples/srq_pingpong.c
+++ b/examples/srq_pingpong.c
@@ -697,7 +697,7 @@ int main(int argc, char *argv[])
 
 		case 'm':
 			mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
-			if (mtu < 0) {
+			if ((int)mtu < 0) {
 				usage(argv[0]);
 				return 1;
 			}
diff --git a/examples/task_pingpong.c b/examples/task_pingpong.c
index 748f8bb..d03a8b2 100644
--- a/examples/task_pingpong.c
+++ b/examples/task_pingpong.c
@@ -1005,7 +1005,7 @@ int main(int argc, char *argv[])
 
 		case 'm':
 			mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
-			if (mtu < 0) {
+			if ((int)mtu < 0) {
 				usage(argv[0]);
 				return 1;
 			}
diff --git a/examples/uc_pingpong.c b/examples/uc_pingpong.c
index 879bd77..a38a054 100644
--- a/examples/uc_pingpong.c
+++ b/examples/uc_pingpong.c
@@ -606,7 +606,7 @@ int main(int argc, char *argv[])
 
 		case 'm':
 			mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
-			if (mtu < 0) {
+			if ((int)mtu < 0) {
 				usage(argv[0]);
 				return 1;
 			}
diff --git a/examples/umr_rc.c b/examples/umr_rc.c
index ab76d3c..0ec636a 100644
--- a/examples/umr_rc.c
+++ b/examples/umr_rc.c
@@ -950,7 +950,7 @@ int main(int argc, char *argv[])
 
 		case 'm':
 			mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
-			if (mtu < 0) {
+			if ((int)mtu < 0) {
 				usage(argv[0]);
 				return 1;
 			}
diff --git a/examples/xsrq_pingpong.c b/examples/xsrq_pingpong.c
index c4ae51d..cebae5d 100644
--- a/examples/xsrq_pingpong.c
+++ b/examples/xsrq_pingpong.c
@@ -910,7 +910,7 @@ int main(int argc, char *argv[])
 			break;
 		case 'm':
 			ctx.mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
-			if (ctx.mtu < 0) {
+			if ((int)ctx.mtu < 0) {
 				usage(argv[0]);
 				return 1;
 			}
-- 
2.14.1