ofp-util: Drop unneeded null pointer tests.
authorBen Pfaff <blp@nicira.com>
Thu, 16 Aug 2012 19:24:01 +0000 (12:24 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 17 Aug 2012 20:26:50 +0000 (13:26 -0700)
The functions being called already do nothing if passed a null pointer.

Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/ofp-util.c

index 492a2b2427ac09a3858f04f564905d670a93748e..1226ace32ad876e262cc94f3ffb283640329fa68 100644 (file)
@@ -1309,10 +1309,7 @@ ofputil_encode_flow_mod(const struct ofputil_flow_mod *fm,
         ofm->out_group = htonl(OFPG11_ANY);
         ofm->flags = htons(fm->flags);
         oxm_put_match(msg, &fm->cr);
-        if (fm->ofpacts) {
-            ofpacts_put_openflow11_instructions(fm->ofpacts, fm->ofpacts_len,
-                                                msg);
-        }
+        ofpacts_put_openflow11_instructions(fm->ofpacts, fm->ofpacts_len, msg);
         break;
     }
 
@@ -1332,9 +1329,7 @@ ofputil_encode_flow_mod(const struct ofputil_flow_mod *fm,
         ofm->buffer_id = htonl(fm->buffer_id);
         ofm->out_port = htons(fm->out_port);
         ofm->flags = htons(fm->flags);
-        if (fm->ofpacts) {
-            ofpacts_put_openflow10(fm->ofpacts, fm->ofpacts_len, msg);
-        }
+        ofpacts_put_openflow10(fm->ofpacts, fm->ofpacts_len, msg);
         break;
     }
 
@@ -1357,9 +1352,7 @@ ofputil_encode_flow_mod(const struct ofputil_flow_mod *fm,
         nfm->out_port = htons(fm->out_port);
         nfm->flags = htons(fm->flags);
         nfm->match_len = htons(match_len);
-        if (fm->ofpacts) {
-            ofpacts_put_openflow10(fm->ofpacts, fm->ofpacts_len, msg);
-        }
+        ofpacts_put_openflow10(fm->ofpacts, fm->ofpacts_len, msg);
         break;
     }