From 2db0e71d3bef334dbb0a73f7118bf92af1cf0890 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Thu, 30 May 2019 15:41:42 +1000 Subject: ctdb-ipalloc: Fix warning about unused value assigned to srcimbl To make this much clearer, move the declaration into the scope where it is used. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/server/ipalloc_lcp2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ctdb/server') diff --git a/ctdb/server/ipalloc_lcp2.c b/ctdb/server/ipalloc_lcp2.c index 6993e7a7014..bc2936bb76e 100644 --- a/ctdb/server/ipalloc_lcp2.c +++ b/ctdb/server/ipalloc_lcp2.c @@ -309,13 +309,12 @@ static bool lcp2_failback_candidate(struct ipalloc_state *ipalloc_state, bool *rebalance_candidates) { unsigned int dstnode, mindstnode, numnodes; - uint32_t srcimbl, srcdsum, dstimbl, dstdsum; + uint32_t srcdsum, dstimbl, dstdsum; uint32_t minsrcimbl, mindstimbl; struct public_ip_list *minip; struct public_ip_list *t; /* Find an IP and destination node that best reduces imbalance. */ - srcimbl = 0; minip = NULL; minsrcimbl = 0; mindstnode = CTDB_UNKNOWN_PNN; @@ -328,6 +327,8 @@ static bool lcp2_failback_candidate(struct ipalloc_state *ipalloc_state, srcnode, lcp2_imbalances[srcnode])); for (t = ipalloc_state->all_ips; t != NULL; t = t->next) { + uint32_t srcimbl; + /* Only consider addresses on srcnode. */ if (t->pnn != srcnode) { continue; -- cgit v1.2.1