X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Flbalance%2Flbalance.c;h=643750cfe3dc01fba51e9e427f3cb21fb7872db7;hb=3a7b8a8a8081ebbb6457527de376dec6264bc381;hp=c3cc4a22752b77266be4d26e42daa4c52fbbe20e;hpb=f69389e6806e2f0b63084576ffa4c84bba699147;p=ccan diff --git a/ccan/lbalance/lbalance.c b/ccan/lbalance/lbalance.c index c3cc4a22..643750cf 100644 --- a/ccan/lbalance/lbalance.c +++ b/ccan/lbalance/lbalance.c @@ -1,3 +1,4 @@ +/* Licensed under GPLv3+ - see LICENSE file for details */ #include #include #include @@ -241,7 +242,7 @@ void lbalance_task_free(struct lbalance_task *task, * are overloaded. */ static unsigned int best_target(const struct lbalance *lb) { - unsigned int i, best = 0, found_drop = 0; + unsigned int i, found_drop = 0; float best_f_max = -1.0, cliff = -1.0; #if 0 @@ -266,7 +267,6 @@ static unsigned int best_target(const struct lbalance *lb) #endif best_f_max = f - (f / (i + 1)) / 4; cliff = f - (f / (i + 1)) / 2; - best = i; found_drop = 0; } else if (!found_drop && f < cliff) { #if 0 @@ -314,7 +314,7 @@ void lbalance_free(struct lbalance *lb) { struct lbalance_task *task; - while ((task = tlist_top(&lb->tasks, struct lbalance_task, list))) { + while ((task = tlist_top(&lb->tasks, list))) { assert(task->lb == lb); tlist_del_from(&lb->tasks, task, list); lb->num_tasks--;