kernel: fix -Wstrict-prototypes warnings/errors

* On newer kernel for some reason -Wno-strict-prototypes still does not fix the errors or warnings.
* To fix it, we just need to add void type.

Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
This commit is contained in:
rsuntk
2025-08-28 15:46:22 +07:00
committed by ShirkNeko
parent a670b82bb6
commit 1294bbe853
13 changed files with 41 additions and 41 deletions

View File

@@ -64,7 +64,7 @@ static void remove_uid_from_arr(uid_t uid)
kfree(temp_arr);
}
static void init_default_profiles()
static void init_default_profiles(void)
{
kernel_cap_t full_cap = CAP_FULL_SET;
@@ -111,7 +111,7 @@ void ksu_show_allow_list(void)
}
#ifdef CONFIG_KSU_DEBUG
static void ksu_grant_root_to_shell()
static void ksu_grant_root_to_shell(void)
{
struct app_profile profile = {
.version = KSU_APP_PROFILE_VER,

View File

@@ -60,10 +60,10 @@ extern int handle_sepolicy(unsigned long arg3, void __user *arg4);
// sucompat.c
static bool ksu_su_compat_enabled = true;
extern void ksu_sucompat_init();
extern void ksu_sucompat_exit();
extern void ksu_sucompat_init(void);
extern void ksu_sucompat_exit(void);
static inline bool is_allow_su()
static inline bool is_allow_su(void)
{
if (is_manager()) {
// we are manager, allow!
@@ -247,7 +247,7 @@ int ksu_handle_rename(struct dentry *old_dentry, struct dentry *new_dentry)
}
#ifdef CONFIG_EXT4_FS
static void nuke_ext4_sysfs()
static void nuke_ext4_sysfs(void)
{
struct path path;
int err = kern_path("/data/adb/modules", 0, &path);
@@ -268,7 +268,7 @@ static void nuke_ext4_sysfs()
path_put(&path);
}
#else
static inline void nuke_ext4_sysfs()
static inline void nuke_ext4_sysfs(void)
{
}
#endif

View File

@@ -60,7 +60,7 @@ static bool android_context_saved_checked = false;
static bool android_context_saved_enabled = false;
static struct ksu_ns_fs_saved android_context_saved;
void ksu_android_ns_fs_check()
void ksu_android_ns_fs_check(void)
{
if (android_context_saved_checked)
return;

View File

@@ -40,7 +40,7 @@ extern long ksu_strncpy_from_user_retry(char *dst,
extern struct key *init_session_keyring;
#endif
extern void ksu_android_ns_fs_check();
extern void ksu_android_ns_fs_check(void);
extern struct file *ksu_filp_open_compat(const char *filename, int flags,
umode_t mode);
extern ssize_t ksu_kernel_read_compat(struct file *p, void *buf, size_t count,

View File

@@ -56,10 +56,10 @@ int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv,
flags);
}
extern void ksu_sucompat_init();
extern void ksu_sucompat_exit();
extern void ksu_ksud_init();
extern void ksu_ksud_exit();
extern void ksu_sucompat_init(void);
extern void ksu_sucompat_exit(void);
extern void ksu_ksud_init(void);
extern void ksu_ksud_exit(void);
#ifdef CONFIG_KSU_TRACEPOINT_HOOK
extern void ksu_trace_register();
extern void ksu_trace_unregister();

View File

@@ -52,9 +52,9 @@ static const char KERNEL_SU_RC[] =
"\n";
static void stop_vfs_read_hook();
static void stop_execve_hook();
static void stop_input_hook();
static void stop_vfs_read_hook(void);
static void stop_execve_hook(void);
static void stop_input_hook(void);
#ifdef CONFIG_KSU_KPROBES_HOOK
static struct work_struct stop_vfs_read_work;
@@ -620,7 +620,7 @@ int __maybe_unused ksu_handle_compat_execve_ksud(
#endif
static void stop_vfs_read_hook()
static void stop_vfs_read_hook(void)
{
#ifdef CONFIG_KSU_KPROBES_HOOK
bool ret = schedule_work(&stop_vfs_read_work);
@@ -631,7 +631,7 @@ static void stop_vfs_read_hook()
#endif
}
static void stop_execve_hook()
static void stop_execve_hook(void)
{
#ifdef CONFIG_KSU_KPROBES_HOOK
bool ret = schedule_work(&stop_execve_hook_work);
@@ -642,7 +642,7 @@ static void stop_execve_hook()
#endif
}
static void stop_input_hook()
static void stop_input_hook(void)
{
#ifdef CONFIG_KSU_KPROBES_HOOK
static bool input_hook_stopped = false;
@@ -662,7 +662,7 @@ static void stop_input_hook()
}
// ksud: module support
void ksu_ksud_init()
void ksu_ksud_init(void)
{
#ifdef CONFIG_KSU_KPROBES_HOOK
int ret;
@@ -682,7 +682,7 @@ void ksu_ksud_init()
#endif
}
void ksu_ksud_exit()
void ksu_ksud_exit(void)
{
#ifdef CONFIG_KSU_KPROBES_HOOK
unregister_kprobe(&execve_kp);

View File

@@ -13,18 +13,18 @@ extern void ksu_add_manager(uid_t uid, int signature_index);
extern void ksu_remove_manager(uid_t uid);
extern int ksu_get_manager_signature_index(uid_t uid);
static inline bool ksu_is_manager_uid_valid()
static inline bool ksu_is_manager_uid_valid(void)
{
return ksu_manager_uid != KSU_INVALID_UID;
}
static inline bool is_manager()
static inline bool is_manager(void)
{
return unlikely(ksu_is_any_manager(current_uid().val) ||
ksu_manager_uid == current_uid().val);
}
static inline uid_t ksu_get_manager_uid()
static inline uid_t ksu_get_manager_uid(void)
{
return ksu_manager_uid;
}
@@ -34,7 +34,7 @@ static inline void ksu_set_manager_uid(uid_t uid)
ksu_manager_uid = uid;
}
static inline void ksu_invalidate_manager_uid()
static inline void ksu_invalidate_manager_uid(void)
{
ksu_manager_uid = KSU_INVALID_UID;
}

View File

@@ -37,7 +37,7 @@ static struct policydb *get_policydb(void)
}
static DEFINE_MUTEX(ksu_rules);
void apply_kernelsu_rules()
void apply_kernelsu_rules(void)
{
struct policydb *db;
@@ -210,7 +210,7 @@ static int get_object(char *buf, char __user *user_object, size_t buf_sz,
}
// reset avc cache table, otherwise the new rules will not take effect if already denied
static void reset_avc_cache()
static void reset_avc_cache(void)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) || \
!defined(KSU_COMPAT_USE_SELINUX_STATE)

View File

@@ -93,7 +93,7 @@ static inline u32 current_sid(void)
}
#endif
bool is_ksu_domain()
bool is_ksu_domain(void)
{
char *domain;
u32 seclen;
@@ -132,7 +132,7 @@ bool is_zygote(void *sec)
#define DEVPTS_DOMAIN "u:object_r:ksu_file:s0"
u32 ksu_get_devpts_sid()
u32 ksu_get_devpts_sid(void)
{
u32 devpts_sid = 0;
int err = security_secctx_to_secid(DEVPTS_DOMAIN, strlen(DEVPTS_DOMAIN),

View File

@@ -15,12 +15,12 @@ void setenforce(bool);
bool getenforce(void);
bool is_ksu_domain();
bool is_ksu_domain(void);
bool is_zygote(void *cred);
void apply_kernelsu_rules();
void apply_kernelsu_rules(void);
u32 ksu_get_devpts_sid();
u32 ksu_get_devpts_sid(void);
#endif

View File

@@ -28,7 +28,7 @@
static const char su[] = SU_PATH;
static const char ksud_path[] = KSUD_PATH;
extern void escape_to_root();
extern void escape_to_root(void);
bool ksu_sucompat_hook_state __read_mostly = true;
@@ -272,7 +272,7 @@ static void destroy_kprobe(struct kprobe **kp_ptr)
#endif
// sucompat: permited process can execute 'su' to gain root access.
void ksu_sucompat_init()
void ksu_sucompat_init(void)
{
#ifdef CONFIG_KSU_KPROBES_HOOK
su_kps[0] = init_kprobe(SYS_EXECVE_SYMBOL, execve_handler_pre);
@@ -289,7 +289,7 @@ void ksu_sucompat_init()
#endif
}
void ksu_sucompat_exit()
void ksu_sucompat_exit(void)
{
#ifdef CONFIG_KSU_KPROBES_HOOK
int i;

View File

@@ -355,7 +355,7 @@ static bool is_uid_exist(uid_t uid, char *package, void *data)
return exist;
}
void track_throne()
void track_throne(void)
{
struct file *fp =
ksu_filp_open_compat(SYSTEM_PACKAGES_LIST_PATH, O_RDONLY, 0);
@@ -467,12 +467,12 @@ out:
}
}
void ksu_throne_tracker_init()
void ksu_throne_tracker_init(void)
{
// nothing to do
}
void ksu_throne_tracker_exit()
void ksu_throne_tracker_exit(void)
{
// nothing to do
}

View File

@@ -1,10 +1,10 @@
#ifndef __KSU_H_THRONE_TRACKER
#define __KSU_H_THRONE_TRACKER
void ksu_throne_tracker_init();
void ksu_throne_tracker_init(void);
void ksu_throne_tracker_exit();
void ksu_throne_tracker_exit(void);
void track_throne();
void track_throne(void);
#endif