From f9859218da827eac5b2102673e7a89497228e672 Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Fri, 14 Dec 2018 19:18:20 +0200 Subject: xlators/cluster/afr/src/afr-self-heal-common.c: remove a variable array. Added '-Wvla' and saw this - gcc doesn't like variable arrays. There are plenty of others in the EC code, but this seems OK to remove: there is no use for the array members (I hope - that was from reading the code). Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul Change-Id: I350f4520e52b86c8bbcd60eea1b27ef99cd119aa --- xlators/cluster/afr/src/afr-self-heal-common.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'xlators/cluster/afr/src') diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 071ed1ccd32..3caa6897424 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -167,27 +167,23 @@ afr_selfheal_gfid_mismatch_by_majority(struct afr_reply *replies, { int j = 0; int i = 0; - int src = -1; - int votes[child_count]; + int votes; for (i = 0; i < child_count; i++) { if (!replies[i].valid || replies[i].op_ret == -1) continue; - votes[i] = 1; + votes = 1; for (j = i + 1; j < child_count; j++) { if ((!gf_uuid_compare(replies[i].poststat.ia_gfid, replies[j].poststat.ia_gfid))) - votes[i]++; - if (votes[i] > child_count / 2) { - src = i; - goto out; - } + votes++; + if (votes > child_count / 2) + return i; } } -out: - return src; + return -1; } int -- cgit