From: David Gibson Date: Wed, 27 Jan 2016 13:14:19 +0000 (+1100) Subject: idtree: Fix comparison is always false warning X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=2b48199f339c411c047dc1ecba889bd413bf2663;hp=71b4e3ad90db6bacc51552438c3f6eb2a20d2631;p=ccan idtree: Fix comparison is always false warning idtree.c:146 triggers a "comparison is always false" warning on some compiler configurations, since the 'id' variable is unsigned. Elsewhere in the module ids seem to be represented by (signed) ints, so use the same convention here, suppressing the warning and also maybe being more correct in other ways. Signed-off-by: David Gibson --- diff --git a/ccan/idtree/idtree.c b/ccan/idtree/idtree.c index e8873926..48add6a8 100644 --- a/ccan/idtree/idtree.c +++ b/ccan/idtree/idtree.c @@ -100,7 +100,8 @@ static int sub_alloc(struct idtree *idp, const void *ptr, int *starting_id) int n, m, sh; struct idtree_layer *p, *pn; struct idtree_layer *pa[MAX_LEVEL+1]; - unsigned int l, id, oid; + unsigned int l; + int id, oid; uint32_t bm; memset(pa, 0, sizeof(pa));