secchan: Make expire_rule() slightly easier to read.
authorBen Pfaff <blp@nicira.com>
Tue, 17 Mar 2009 17:51:21 +0000 (10:51 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 17 Mar 2009 17:51:21 +0000 (10:51 -0700)
Search-and-replace "expiration" by "expire".  In the next commit this
will keep from needing to wrap more lines, making the code easier to read
there too.

secchan/ofproto.c

index d27cc3bfb22c3c29be31fbd2908dc1a97896f7c1..f778c0e4770bd3832c44219beea943e050c51a9f 100644 (file)
@@ -2894,23 +2894,22 @@ expire_rule(struct cls_rule *cls_rule, void *p_)
 {
     struct ofproto *p = p_;
     struct rule *rule = rule_from_cls_rule(cls_rule);
-    long long int hard_expiration, idle_expiration, expiration, now;
-
-    hard_expiration = (rule->hard_timeout
-                       ? rule->created + rule->hard_timeout * 1000
-                       : LLONG_MAX);
-    idle_expiration = (rule->idle_timeout
-                       && (rule->super || list_is_empty(&rule->list))
-                       ? rule->used + rule->idle_timeout * 1000
-                       : LLONG_MAX);
-    expiration = MIN(hard_expiration, idle_expiration);
-
-    if (expiration == LLONG_MAX) {
+    long long int hard_expire, idle_expire, expire, now;
+
+    hard_expire = (rule->hard_timeout
+                   ? rule->created + rule->hard_timeout * 1000
+                   : LLONG_MAX);
+    idle_expire = (rule->idle_timeout
+                   && (rule->super || list_is_empty(&rule->list))
+                   ? rule->used + rule->idle_timeout * 1000
+                   : LLONG_MAX);
+    expire = MIN(hard_expire, idle_expire);
+    if (expire == LLONG_MAX) {
         return;
     }
 
     now = time_msec();
-    if (now < expiration) {
+    if (now < expire) {
         return;
     }
 
@@ -2934,7 +2933,7 @@ expire_rule(struct cls_rule *cls_rule, void *p_)
     }
 
     send_flow_exp(p, rule, now,
-                  (now >= hard_expiration
+                  (now >= hard_expire
                    ? OFPER_HARD_TIMEOUT : OFPER_IDLE_TIMEOUT));
     classifier_remove(&p->cls, &rule->cr);
     rule_destroy(rule);