From: Ben Pfaff Date: Thu, 16 Aug 2012 19:24:01 +0000 (-0700) Subject: ofp-util: Drop unneeded null pointer tests. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b289eaf9f880c5284510a45db8e13f55f4968f3;p=openvswitch ofp-util: Drop unneeded null pointer tests. The functions being called already do nothing if passed a null pointer. Signed-off-by: Ben Pfaff --- diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 492a2b24..1226ace3 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; }