ofproto: Avoid extra call to time_msec().
authorBen Pfaff <blp@nicira.com>
Tue, 9 Mar 2010 18:03:29 +0000 (10:03 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 9 Mar 2010 18:03:29 +0000 (10:03 -0800)
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.

ofproto/ofproto.c

index 1a653ec4113bf46fd04675747c486ad40c6c5452..fcc76d6cbfee19f9b75d6e1d30f9fccdd3e9ea7d 100644 (file)
@@ -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);