]> git.proxmox.com Git - ovs.git/commitdiff
odp-util: Fix compiler warning.
authorAaron Conole <aconole@bytheb.org>
Tue, 16 Jan 2018 14:05:47 +0000 (09:05 -0500)
committerJustin Pettit <jpettit@ovn.org>
Thu, 18 Jan 2018 21:05:23 +0000 (13:05 -0800)
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'

Found with Apple LLVM version 8.1.0 (clang-802.0.42).

Squelch this by preferring the %d format specifier to print 1/0 values.

Fixes: 74c4530dca93 ("ofproto-dpif: Don't slow-path controller actions with pause.")
Cc: Justin Pettit <jpettit@ovn.org>
Signed-off-by: Aaron Conole <aconole@bytheb.org>
Acked-by: Ian Stokes <ian.stokes@intel.com>
Tested-by: Ian Stokes <ian.stokes@intel.com>
Signed-off-by: Justin Pettit <jpettit@ovn.org>
lib/odp-util.c

index af995efca64831c3ad7e2b3194636b878da809d7..8a5e9e82eaa8555d5f854d83e807eb79610310e8 100644 (file)
@@ -481,8 +481,8 @@ format_odp_userspace_action(struct ds *ds, const struct nlattr *attr,
                 ds_put_char(ds, ')');
             } else if (cookie.type == USER_ACTION_COOKIE_CONTROLLER) {
                 ds_put_format(ds, ",controller(reason=%"PRIu16
-                              ",dont_send=%"PRIu8
-                              ",continuation=%"PRIu8
+                              ",dont_send=%d"
+                              ",continuation=%d"
                               ",recirc_id=%"PRIu32
                               ",rule_cookie=%#"PRIx64
                               ",controller_id=%"PRIu16