The patch titled Subject: dynamic_debug: use pointer comparison in ddebug_remove_module has been added to the -mm tree. Its filename is dynamic_debug-use-pointer-comparison-in-ddebug_remove_module.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/dynamic_debug-use-pointer-comparison-in-ddebug_remove_module.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/dynamic_debug-use-pointer-comparison-in-ddebug_remove_module.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx> Subject: dynamic_debug: use pointer comparison in ddebug_remove_module Now that we store the passed-in string directly in ddebug_add_module, we can use pointer equality instead of strcmp. This is a little more efficient, but more importantly, this also makes the code somewhat more correct: Currently, if one loads and then unloads a module whose name happens to match the KBUILD_MODNAME of some built-in functionality (which need not even be modular at all), all of their dynamic debug entries vanish along with those of the actual module. For example, loading and unloading a core.ko hides all pr_debugs from drivers/base/core.c and other built-in files called core.c (incidentally, there is an in-tree module whose name is core, but I just tested this with an out-of-tree trivial one). Link: http://lkml.kernel.org/r/20190212214150.4807-7-linux@xxxxxxxxxxxxxxxxxx Signed-off-by: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx> Acked-by: Jason Baron <jbaron@xxxxxxxxxx> Cc: David Sterba <dsterba@xxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxxxxx> Cc: Petr Mladek <pmladek@xxxxxxxx> Cc: "Rafael J . Wysocki" <rafael.j.wysocki@xxxxxxxxx> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/dynamic_debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/lib/dynamic_debug.c~dynamic_debug-use-pointer-comparison-in-ddebug_remove_module +++ a/lib/dynamic_debug.c @@ -929,9 +929,10 @@ int ddebug_remove_module(const char *mod mutex_lock(&ddebug_lock); list_for_each_entry_safe(dt, nextdt, &ddebug_tables, link) { - if (!strcmp(dt->mod_name, mod_name)) { + if (dt->mod_name == mod_name) { ddebug_table_free(dt); ret = 0; + break; } } mutex_unlock(&ddebug_lock); _ Patches currently in -mm which might be from linux@xxxxxxxxxxxxxxxxxx are build_bugh-add-wrapper-for-_static_assert.patch lib-vsprintfc-move-sizeofstruct-printf_spec-next-to-its-definition.patch linux-fsh-move-member-alignment-check-next-to-definition-of-struct-filename.patch linux-deviceh-use-dynamic_debug_branch-in-dev_dbg_ratelimited.patch linux-neth-use-dynamic_debug_branch-in-net_dbg_ratelimited.patch linux-printkh-use-dynamic_debug_branch-in-pr_debug_ratelimited.patch dynamic_debug-consolidate-define_dynamic_debug_metadata-definitions.patch dynamic_debug-dont-duplicate-modname-in-ddebug_add_module.patch dynamic_debug-use-pointer-comparison-in-ddebug_remove_module.patch dynamic_debug-remove-unused-export_symbols.patch dynamic_debug-move-pr_err-from-modulec-to-ddebug_add_module.patch dynamic_debug-add-static-inline-stub-for-ddebug_add_module.patch dynamic_debug-refactor-dynamic_pr_debug-and-friends.patch btrfs-implement-btrfs_debug-in-terms-of-helper-macro.patch acpi-use-proper-dynamic_debug_branch-macro.patch acpi-remove-unused-__acpi_handle_debug-macro.patch acpi-implement-acpi_handle_debug-in-terms-of-_dynamic_func_call.patch