Skip to content

Commit 3cc754c

Browse files
Jinjie Ruanpalmer-dabbelt
authored andcommitted
riscv: Use LIST_HEAD() to simplify code
list_head can be initialized automatically with LIST_HEAD() instead of calling INIT_LIST_HEAD(). Signed-off-by: Jinjie Ruan <[email protected]> Tested-by: Charlie Jenkins <[email protected]> Reviewed-by: Charlie Jenkins <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent e36ddf3 commit 3cc754c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

arch/riscv/kernel/module.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -787,17 +787,15 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
787787
int res;
788788
unsigned int num_relocations = sechdrs[relsec].sh_size / sizeof(*rel);
789789
struct hlist_head *relocation_hashtable;
790-
struct list_head used_buckets_list;
791790
unsigned int hashtable_bits;
791+
LIST_HEAD(used_buckets_list);
792792

793793
hashtable_bits = initialize_relocation_hashtable(num_relocations,
794794
&relocation_hashtable);
795795

796796
if (!relocation_hashtable)
797797
return -ENOMEM;
798798

799-
INIT_LIST_HEAD(&used_buckets_list);
800-
801799
pr_debug("Applying relocate section %u to %u\n", relsec,
802800
sechdrs[relsec].sh_info);
803801

0 commit comments

Comments
 (0)