Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tracepoints: use TABLE_SIZE macro

Steven Rostedt suggested:

| Wouldn't it look nicer to have: (TRACEPOINT_TABLE_SIZE - 1) ?

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

Mathieu Desnoyers and committed by
Ingo Molnar
9795302a 611b1597

+3 -3
+3 -3
kernel/tracepoint.c
··· 177 177 struct tracepoint_entry *e; 178 178 u32 hash = jhash(name, strlen(name), 0); 179 179 180 - head = &tracepoint_table[hash & ((1 << TRACEPOINT_HASH_BITS)-1)]; 180 + head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)]; 181 181 hlist_for_each_entry(e, node, head, hlist) { 182 182 if (!strcmp(name, e->name)) 183 183 return e; ··· 197 197 size_t name_len = strlen(name) + 1; 198 198 u32 hash = jhash(name, name_len-1, 0); 199 199 200 - head = &tracepoint_table[hash & ((1 << TRACEPOINT_HASH_BITS)-1)]; 200 + head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)]; 201 201 hlist_for_each_entry(e, node, head, hlist) { 202 202 if (!strcmp(name, e->name)) { 203 203 printk(KERN_NOTICE ··· 233 233 size_t len = strlen(name) + 1; 234 234 u32 hash = jhash(name, len-1, 0); 235 235 236 - head = &tracepoint_table[hash & ((1 << TRACEPOINT_HASH_BITS)-1)]; 236 + head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)]; 237 237 hlist_for_each_entry(e, node, head, hlist) { 238 238 if (!strcmp(name, e->name)) { 239 239 found = 1;