[ovs-dev] [PATCH] ofproto: Avoid extra call to time_msec().

Ben Pfaff blp at nicira.com
Tue Mar 9 00:38:26 UTC 2010


compose_flow_removed() alreadyu 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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 1a653ec..fcc76d6 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);
 
-- 
1.6.6.1





More information about the dev mailing list