diff options
author | Martin Schwenke <martin@meltin.net> | 2019-05-30 15:41:42 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2019-06-05 10:25:50 +0000 |
commit | 2db0e71d3bef334dbb0a73f7118bf92af1cf0890 (patch) | |
tree | 523a856e3204b26a1047ea915c5b0218653e8c1a | |
parent | 7df15b246abb9ea2f606f5739a02cfec51f6d9cb (diff) | |
download | samba-2db0e71d3bef334dbb0a73f7118bf92af1cf0890.tar.gz |
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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
-rw-r--r-- | ctdb/server/ipalloc_lcp2.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; |