From: Ben Pfaff Date: Tue, 9 Mar 2010 18:03:29 +0000 (-0800) Subject: ofproto: Avoid extra call to time_msec(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ca76894292bcb9aafbdaa63f24e370b1a6ccac8;p=openvswitch ofproto: Avoid extra call to time_msec(). compose_flow_removed() already has the current time conveniently provided as a parameter, so there is no need to call time_msec() directly. Also squashes an annoying GCC warning about an unused parameter. --- diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 1a653ec4..fcc76d6c 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -3335,7 +3335,7 @@ compose_flow_removed(const struct rule *rule, long long int now, uint8_t reason) { struct ofp_flow_removed *ofr; struct ofpbuf *buf; - long long int tdiff = time_msec() - rule->created; + long long int tdiff = now - rule->created; uint32_t sec = tdiff / 1000; uint32_t msec = tdiff - (sec * 1000);