[ovs-dev] [PATCH v2] odp-util: Fix Sparse warning.

Ben Pfaff blp at ovn.org
Thu Jan 11 18:26:46 UTC 2018


From: Ian Stokes <ian.stokes at intel.com>

Sparse complains with warning: incorrect type in argument 1 (different
base types) in function parse_odp_userspace_action due to a call to
htonll(rule_cookie). Rule_cookie variable is already ovs_be64 so fix
this by removing the call to htonll as there is no need to convert for
use with put_32aligned_be64().

CC: Justin Pettit <jpettit at ovn.org>
Fixes: d39ec23de384 ("ofproto-dpif: Don't slow-path controller actions.")
Signed-off-by: Ian Stokes <ian.stokes at intel.com>
[blp at ovn.org updated parse_odp_userspace_action()]
Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 lib/odp-util.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/odp-util.c b/lib/odp-util.c
index f8c84e17330f..fa1a5c94c2fa 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -1245,8 +1245,7 @@ parse_odp_userspace_action(const char *s, struct ofpbuf *actions)
             cookie.controller.continuation = continuation ? true : false;
             cookie.controller.reason = reason;
             cookie.controller.recirc_id = recirc_id;
-            put_32aligned_be64(&cookie.controller.rule_cookie,
-                               htonll(rule_cookie));
+            put_32aligned_be64(&cookie.controller.rule_cookie, rule_cookie);
             cookie.controller.controller_id = controller_id;
             cookie.controller.max_len = max_len;
        } else if (ovs_scan(&s[n], ",userdata(%n", &n1)) {
-- 
2.10.2



More information about the dev mailing list