Skip to contentSkip to conversation

module: include internal.h in module/dups.c

PATCH New Arnd Bergmann 1 participant 1 message Apr 29, 2023 Module support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 module: include internal.h in module/dups.c

From: Arnd Bergmann <[email protected]>

Two newly introduced functions are declared in a header that is not included before the definition, causing a warning with sparse or 'make W=1':

kernel/module/dups.c:118:6: error: no previous prototype for 'kmod_dup_request_exists_wait' [-Werror=missing-prototypes]
118 | bool kmod_dup_request_exists_wait(char *module_name, bool wait, int *dup_ret)

      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/module/dups.c:220:6: error: no previous prototype for 'kmod_dup_request_announce' [-Werror=missing-prototypes]
  220 | void kmod_dup_request_announce(char *module_name, int ret)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~

Add an explicit include to ensure the prototypes match.

Fixes 8660484ed1cf ("module: add debugging auto-load duplicate module support")
---
 kernel/module/dups.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/module/dups.c +2 -0
index aa8e1361fdb5..f3d7ea1e96d8 100644
@@ -32,6 +32,8 @@
 #include <linux/async.h>
 #include <linux/uaccess.h>
 
+#include "internal.h"
+
 #undef MODULE_PARAM_PREFIX
 #define MODULE_PARAM_PREFIX "module."
 static bool enable_dups_trace = IS_ENABLED(CONFIG_MODULE_DEBUG_AUTOLOAD_DUPS_TRACE);
Signature · 1 line
2.39.2