Skip to content

Commit ed87277

Browse files
Chen Zhongjinrostedt
authored andcommitted
tracing: Remove unused variable 'dups'
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/[email protected] Signed-off-by: Chen Zhongjin <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 0e0f0b7 commit ed87277

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

kernel/trace/tracing_map.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ create_sort_entry(void *key, struct tracing_map_elt *elt)
961961
static void detect_dups(struct tracing_map_sort_entry **sort_entries,
962962
int n_entries, unsigned int key_size)
963963
{
964-
unsigned int dups = 0, total_dups = 0;
964+
unsigned int total_dups = 0;
965965
int i;
966966
void *key;
967967

@@ -974,11 +974,10 @@ static void detect_dups(struct tracing_map_sort_entry **sort_entries,
974974
key = sort_entries[0]->key;
975975
for (i = 1; i < n_entries; i++) {
976976
if (!memcmp(sort_entries[i]->key, key, key_size)) {
977-
dups++; total_dups++;
977+
total_dups++;
978978
continue;
979979
}
980980
key = sort_entries[i]->key;
981-
dups = 0;
982981
}
983982

984983
WARN_ONCE(total_dups > 0,

0 commit comments

Comments
 (0)