From 7e595e17302e1377b79fe29dc0074c69bf44e264 Mon Sep 17 00:00:00 2001 From: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com> Date: Tue, 11 Nov 2025 16:49:09 +0800 Subject: [PATCH] kernel: Public ksu_handle_sys_reboot - clean code --- kernel/ksu.h | 2 ++ kernel/supercalls.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/ksu.h b/kernel/ksu.h index 2f6f9859..93750af8 100644 --- a/kernel/ksu.h +++ b/kernel/ksu.h @@ -43,6 +43,7 @@ struct manager_list_info { bool ksu_queue_work(struct work_struct *work); +#if 0 static inline int startswith(char *s, char *prefix) { return strncmp(s, prefix, strlen(prefix)); @@ -56,5 +57,6 @@ static inline int endswith(const char *s, const char *t) return 1; return strcmp(s + slen - tlen, t); } +#endif #endif diff --git a/kernel/supercalls.c b/kernel/supercalls.c index 4ccad162..f0143f86 100644 --- a/kernel/supercalls.c +++ b/kernel/supercalls.c @@ -742,8 +742,6 @@ static const struct ksu_ioctl_cmd_map ksu_ioctl_handlers[] = { { .cmd = 0, .name = NULL, .handler = NULL, .perm_check = NULL} // Sentine }; -#ifdef KSU_KPROBES_HOOK - struct ksu_install_fd_tw { struct callback_head cb; int __user *outp; @@ -801,6 +799,7 @@ int ksu_handle_sys_reboot(int magic1, int magic2, unsigned int cmd, void __user return 0; } +#ifdef KSU_KPROBES_HOOK // Reboot hook for installing fd static int reboot_handler_pre(struct kprobe *p, struct pt_regs *regs) {