The result of a ternary operation will be promoted at least to int
type. As such, the compiler may generate a warning as:
format specifies type 'unsigned char' but the argument has type 'int'
This commit explicitly casts the result to avoid the warning.
Fixes: 74c4530dca93 ("ofproto-dpif: Don't slow-path controller actions with
pause.")
Cc: Justin Pettit <[email protected]>
Signed-off-by: Aaron Conole <[email protected]>
---
lib/odp-util.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/odp-util.c b/lib/odp-util.c
index af995efca..16f9bcd54 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -488,8 +488,8 @@ format_odp_userspace_action(struct ds *ds, const struct
nlattr *attr,
",controller_id=%"PRIu16
",max_len=%"PRIu16,
cookie.controller.reason,
- cookie.controller.dont_send ? 1 : 0,
- cookie.controller.continuation ? 1 : 0,
+ (uint8_t)(cookie.controller.dont_send ? 1 : 0),
+ (uint8_t)(cookie.controller.continuation ? 1 :
0),
cookie.controller.recirc_id,
ntohll(get_32aligned_be64(
&cookie.controller.rule_cookie)),
--
2.14.3
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev