Skip to content

Commit

Permalink
tracing: Remove unused variable 'dups'
Browse files Browse the repository at this point in the history
Reported by Clang [-Wunused-but-set-variable]

'commit c193707 ("tracing: Remove code which merges duplicates")'
This commit removed the code which merges duplicates in detect_dups(),
but forgot to delete the variable 'dups' which used to merge
duplicates in the loop.

Now only 'total_dups' is needed, remove 'dups' for clean code.

Link: https://lkml.kernel.org/r/20220930103236.253985-1-chenzhongjin@huawei.com

Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
  • Loading branch information
Chen Zhongjin authored and Steven Rostedt (Google) committed Oct 3, 2022
1 parent 0e0f0b7 commit ed87277
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kernel/trace/tracing_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ create_sort_entry(void *key, struct tracing_map_elt *elt)
static void detect_dups(struct tracing_map_sort_entry **sort_entries,
int n_entries, unsigned int key_size)
{
unsigned int dups = 0, total_dups = 0;
unsigned int total_dups = 0;
int i;
void *key;

Expand All @@ -974,11 +974,10 @@ static void detect_dups(struct tracing_map_sort_entry **sort_entries,
key = sort_entries[0]->key;
for (i = 1; i < n_entries; i++) {
if (!memcmp(sort_entries[i]->key, key, key_size)) {
dups++; total_dups++;
total_dups++;
continue;
}
key = sort_entries[i]->key;
dups = 0;
}

WARN_ONCE(total_dups > 0,
Expand Down

0 comments on commit ed87277

Please sign in to comment.