From: Emil Velikov Date: Thu, 29 May 2025 14:31:36 +0000 (+0100) Subject: testsuite/{init,delete}_module: add TODOs for args validation X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=abb9e04215ce84d1f9d91b52c74d4f88c973bd9c;p=thirdparty%2Fkmod.git testsuite/{init,delete}_module: add TODOs for args validation Currently we pass arguments to our *_module wrappers, which are lacking any validation. Add a few TODO notes and silence the unused argument compiler warnings. Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/361 Signed-off-by: Lucas De Marchi --- diff --git a/testsuite/delete_module.c b/testsuite/delete_module.c index 84bf0ff8..023f58a1 100644 --- a/testsuite/delete_module.c +++ b/testsuite/delete_module.c @@ -186,7 +186,8 @@ fail: */ TS_EXPORT long delete_module(const char *name, unsigned int flags); -long delete_module(const char *modname, unsigned int flags) +/* TODO: add simple validation of the flags passed and remove the _maybe_unused_ workaround */ +long delete_module(const char *modname, _maybe_unused_ unsigned int flags) { DECLARE_STRBUF_WITH_STACK(buf, PATH_MAX); struct mod *mod; diff --git a/testsuite/init_module.c b/testsuite/init_module.c index 82942a70..8ff26999 100644 --- a/testsuite/init_module.c +++ b/testsuite/init_module.c @@ -224,7 +224,8 @@ TS_EXPORT long init_module(void *mem, unsigned long len, const char *args); * This is because we want to be able to pass dummy modules (and not real * ones) and it still work. */ -long init_module(void *mem, unsigned long len, const char *args) +/* TODO: add simple validation of the args passed and remove the _maybe_unused_ workaround */ +long init_module(void *mem, unsigned long len, _maybe_unused_ const char *args) { const char *modname; struct kmod_elf *elf; @@ -300,7 +301,8 @@ static int check_kernel_version(int major, int minor) TS_EXPORT int finit_module(const int fd, const char *args, const int flags); -int finit_module(const int fd, const char *args, const int flags) +/* TODO: add simple validation of the flags passed and remove the _maybe_unused_ workaround */ +int finit_module(const int fd, const char *args, _maybe_unused_ const int flags) { int err; void *mem;