Unverified Commit 641e8cd2 authored by Kefeng Wang's avatar Kefeng Wang Committed by Palmer Dabbelt
Browse files

riscv: Cleanup sbi function stubs when RISCV_SBI disabled



Fix sbi_init() function declaration mismatch between RISCV_SBI
enable and disable, as it always returned 0, make it void function.

Drop some stubs which won't be used if RISCV_SBI disabled.

Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: default avatarAtish Patra <atish.patra@wdc.com>
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent e71ba945
Loading
Loading
Loading
Loading
+3 −7
Original line number Original line Diff line number Diff line
@@ -89,7 +89,7 @@ struct sbiret {
	long value;
	long value;
};
};


int sbi_init(void);
void sbi_init(void);
struct sbiret sbi_ecall(int ext, int fid, unsigned long arg0,
struct sbiret sbi_ecall(int ext, int fid, unsigned long arg0,
			unsigned long arg1, unsigned long arg2,
			unsigned long arg1, unsigned long arg2,
			unsigned long arg3, unsigned long arg4,
			unsigned long arg3, unsigned long arg4,
@@ -147,11 +147,7 @@ static inline unsigned long sbi_minor_version(void)


int sbi_err_map_linux_errno(int err);
int sbi_err_map_linux_errno(int err);
#else /* CONFIG_RISCV_SBI */
#else /* CONFIG_RISCV_SBI */
/* stubs for code that is only reachable under IS_ENABLED(CONFIG_RISCV_SBI): */
static inline void sbi_remote_fence_i(const unsigned long *hart_mask) {}
void sbi_set_timer(uint64_t stime_value);
static inline void sbi_init(void) {}
void sbi_clear_ipi(void);
void sbi_send_ipi(const unsigned long *hart_mask);
void sbi_remote_fence_i(const unsigned long *hart_mask);
void sbi_init(void);
#endif /* CONFIG_RISCV_SBI */
#endif /* CONFIG_RISCV_SBI */
#endif /* _ASM_RISCV_SBI_H */
#endif /* _ASM_RISCV_SBI_H */
+1 −3
Original line number Original line Diff line number Diff line
@@ -560,7 +560,7 @@ static struct riscv_ipi_ops sbi_ipi_ops = {
	.ipi_inject = sbi_send_cpumask_ipi
	.ipi_inject = sbi_send_cpumask_ipi
};
};


int __init sbi_init(void)
void __init sbi_init(void)
{
{
	int ret;
	int ret;


@@ -600,6 +600,4 @@ int __init sbi_init(void)
	}
	}


	riscv_set_ipi_ops(&sbi_ipi_ops);
	riscv_set_ipi_ops(&sbi_ipi_ops);

	return 0;
}
}
+1 −2
Original line number Original line Diff line number Diff line
@@ -251,7 +251,6 @@ void __init setup_arch(char **cmdline_p)
		pr_err("No DTB found in kernel mappings\n");
		pr_err("No DTB found in kernel mappings\n");
#endif
#endif


	if (IS_ENABLED(CONFIG_RISCV_SBI))
	sbi_init();
	sbi_init();


	if (IS_ENABLED(CONFIG_STRICT_KERNEL_RWX))
	if (IS_ENABLED(CONFIG_STRICT_KERNEL_RWX))