Unverified Commit 3cc754c2 authored by Jinjie Ruan's avatar Jinjie Ruan Committed by Palmer Dabbelt
Browse files

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: default avatarJinjie Ruan <ruanjinjie@huawei.com>
Tested-by: default avatarCharlie Jenkins <charlie@rivosinc.com>
Reviewed-by: default avatarCharlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20240904013344.2026738-1-ruanjinjie@huawei.com


Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent e36ddf32
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -787,8 +787,8 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
	int res;
	unsigned int num_relocations = sechdrs[relsec].sh_size / sizeof(*rel);
	struct hlist_head *relocation_hashtable;
	struct list_head used_buckets_list;
	unsigned int hashtable_bits;
	LIST_HEAD(used_buckets_list);

	hashtable_bits = initialize_relocation_hashtable(num_relocations,
							 &relocation_hashtable);
@@ -796,8 +796,6 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
	if (!relocation_hashtable)
		return -ENOMEM;

	INIT_LIST_HEAD(&used_buckets_list);

	pr_debug("Applying relocate section %u to %u\n", relsec,
	       sechdrs[relsec].sh_info);