From d2d9821170c4417398c89308724ac7522555cf25 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 7 Oct 2018 12:48:17 -0700 Subject: [PATCH] Fix warning about unused variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 810903bdb9db ("Import: pass a dive table to process_imported_dives()") introduced the variables struct dive *old_dive, *merged; into process_imported_dives(), but never used them. It seems to be an artifact of having split the function to use the try_to_merge_into() helper function (that has those same variable names and _does_ use them), but forgetting the original variables from the pre-split case. Gcc understandably warns about it: core/divelist.c: In function ‘process_imported_dives’: core/divelist.c:1351:26: warning: unused variable ‘merged’ [-Wunused-variable] struct dive *old_dive, *merged; ^~~~~~ core/divelist.c:1351:15: warning: unused variable ‘old_dive’ [-Wunused-variable] struct dive *old_dive, *merged; ^~~~~~~~ and the trivial fix is to just remove that line that declares the stale and unused variables. Signed-off-by: Linus Torvalds --- core/divelist.c | 1 - 1 file changed, 1 deletion(-) diff --git a/core/divelist.c b/core/divelist.c index 916da4605..8d0fa77e5 100644 --- a/core/divelist.c +++ b/core/divelist.c @@ -1348,7 +1348,6 @@ static bool try_to_merge_into(struct dive *dive_to_add, int idx, bool prefer_imp void process_imported_dives(struct dive_table *import_table, bool prefer_imported, bool downloaded) { int i, j; - struct dive *old_dive, *merged; int preexisting; bool sequence_changed = false;