From 5b289eaf9f880c5284510a45db8e13f55f4968f3 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 16 Aug 2012 12:24:01 -0700 Subject: [PATCH] ofp-util: Drop unneeded null pointer tests. The functions being called already do nothing if passed a null pointer. Signed-off-by: Ben Pfaff --- lib/ofp-util.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 492a2b242..1226ace32 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -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; } -- 2.43.0