]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
libkmod: silence unused param warnings for kmod_file_load_*() stubs
authorEmil Velikov <emil.l.velikov@gmail.com>
Fri, 30 May 2025 10:52:27 +0000 (11:52 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Wed, 11 Jun 2025 12:54:40 +0000 (07:54 -0500)
When building without compression, the respective load functions are
static inline header stubs. In which case the struct kmod_file *file is
always unused and the compiler rightfully warns about it.

Not much we can do here, other than annotate them to silence the
warnings.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/361
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
libkmod/libkmod-internal-file.h

index a50d06e85402d2dfeaaa51c1768ba07d24e0b3c0..87588887b44a7d257ca68519680679a988133fad 100644 (file)
@@ -23,7 +23,7 @@ struct kmod_file {
 #if ENABLE_XZ
 int kmod_file_load_xz(struct kmod_file *file);
 #else
-static inline int kmod_file_load_xz(struct kmod_file *file)
+static inline int kmod_file_load_xz(_maybe_unused_ struct kmod_file *file)
 {
        return -ENOSYS;
 }
@@ -32,7 +32,7 @@ static inline int kmod_file_load_xz(struct kmod_file *file)
 #if ENABLE_ZLIB
 int kmod_file_load_zlib(struct kmod_file *file);
 #else
-static inline int kmod_file_load_zlib(struct kmod_file *file)
+static inline int kmod_file_load_zlib(_maybe_unused_ struct kmod_file *file)
 {
        return -ENOSYS;
 }
@@ -41,7 +41,7 @@ static inline int kmod_file_load_zlib(struct kmod_file *file)
 #if ENABLE_ZSTD
 int kmod_file_load_zstd(struct kmod_file *file);
 #else
-static inline int kmod_file_load_zstd(struct kmod_file *file)
+static inline int kmod_file_load_zstd(_maybe_unused_ struct kmod_file *file)
 {
        return -ENOSYS;
 }