Skip to content

Commit a7c54b2

Browse files
petrpavludkruces
authored andcommitted
tracing: Replace MAX_PARAM_PREFIX_LEN with MODULE_NAME_LEN
Use the MODULE_NAME_LEN definition in module_exists() to obtain the maximum size of a module name, instead of using MAX_PARAM_PREFIX_LEN. The values are the same but MODULE_NAME_LEN is more appropriate in this context. MAX_PARAM_PREFIX_LEN was added in commit 730b69d ("module: check kernel param length at compile time, not runtime") only to break a circular dependency between module.h and moduleparam.h, and should mostly be limited to use in moduleparam.h. Signed-off-by: Petr Pavlu <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Masami Hiramatsu <[email protected]> Reviewed-by: Daniel Gomez <[email protected]> Acked-by: Steven Rostedt (Google) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Gomez <[email protected]>
1 parent bdc877b commit a7c54b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10367,7 +10367,7 @@ bool module_exists(const char *module)
1036710367
{
1036810368
/* All modules have the symbol __this_module */
1036910369
static const char this_mod[] = "__this_module";
10370-
char modname[MAX_PARAM_PREFIX_LEN + sizeof(this_mod) + 2];
10370+
char modname[MODULE_NAME_LEN + sizeof(this_mod) + 2];
1037110371
unsigned long val;
1037210372
int n;
1037310373

0 commit comments

Comments
 (0)