Skip to contentSkip to conversation

sched/credit: Remove redundant assignments from alloc_* functions

PATCH In review Andrew Cooper 2 participants 2 messages Sep 12, 2013 – Sep 13, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/credit: Remove redundant assignments from alloc_* functions

Noticed because Coverity was complaining at the atomic_set(), but because of the use of xzalloc(), these assignments of 0 are completely redundent.

CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>
CC George Dunlap <[email protected]>
---
 xen/common/sched_credit.c |    4 ----
 1 file changed, 4 deletions(-)
xen/common/sched_credit.c +0 -4
index 0b81662..dbe6de6 100644
@@ -858,8 +858,6 @@ csched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
     INIT_LIST_HEAD(&svc->active_vcpu_elem);
     svc->sdom = dd;
     svc->vcpu = vc;
-    atomic_set(&svc->credit, 0);
-    svc->flags = 0U;
     svc->pri = is_idle_domain(vc->domain) ?
         CSCHED_PRI_IDLE : CSCHED_PRI_TS_UNDER;
     SCHED_VCPU_STATS_RESET(svc);
@@ -1081,11 +1079,9 @@ csched_alloc_domdata(const struct scheduler *ops, struct domain *dom)
 
     /* Initialize credit and weight */
     INIT_LIST_HEAD(&sdom->active_vcpu);
-    sdom->active_vcpu_count = 0;
     INIT_LIST_HEAD(&sdom->active_sdom_elem);
     sdom->dom = dom;
     sdom->weight = CSCHED_DEFAULT_WEIGHT;
-    sdom->cap = 0U;
 
     return (void *)sdom;
 }
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Andrew Cooper

Noticed because Coverity was complaining at the atomic_set(), but because of the use of xzalloc(), these assignments of 0 are completely redundent.

Quoted 40 lines
CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>
CC George Dunlap <[email protected]>
---
 xen/common/sched_credit.c |    4 ----
 1 file changed, 4 deletions(-)
xen/common/sched_credit.c +0 -5
index 0b81662..dbe6de6 100644
@@ -858,8 +858,6 @@ csched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
     INIT_LIST_HEAD(&svc->active_vcpu_elem);
     svc->sdom = dd;
     svc->vcpu = vc;
-    atomic_set(&svc->credit, 0);
-    svc->flags = 0U;
     svc->pri = is_idle_domain(vc->domain) ?
         CSCHED_PRI_IDLE : CSCHED_PRI_TS_UNDER;
     SCHED_VCPU_STATS_RESET(svc);
@@ -1081,11 +1079,9 @@ csched_alloc_domdata(const struct scheduler *ops, struct domain *dom)
 
     /* Initialize credit and weight */
     INIT_LIST_HEAD(&sdom->active_vcpu);
-    sdom->active_vcpu_count = 0;
     INIT_LIST_HEAD(&sdom->active_sdom_elem);
     sdom->dom = dom;
     sdom->weight = CSCHED_DEFAULT_WEIGHT;
-    sdom->cap = 0U;
 
     return (void *)sdom;
 }
--

1.7.10.4

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel