The patch titled Subject: kernel/panic.c: taint: fix debugfs_simple_attr.cocci warnings has been added to the -mm tree. Its filename is taint-fix-debugfs_simple_attrcocci-warnings.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/taint-fix-debugfs_simple_attrcocci-warnings.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/taint-fix-debugfs_simple_attrcocci-warnings.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: YueHaibing <yuehaibing@xxxxxxxxxx> Subject: kernel/panic.c: taint: fix debugfs_simple_attr.cocci warnings Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for debugfs files. Semantic patch information: Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file() imposes some significant overhead as compared to DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe(). Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci Link: http://lkml.kernel.org/r/1545990861-158097-1-git-send-email-yuehaibing@xxxxxxxxxx Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx> Cc: Sergey Senozhatsky <sergey.senozhatsky.work@xxxxxxxxx> Cc: Kees Cook <keescook@xxxxxxxxxxxx> Cc: Borislav Petkov <bp@xxxxxxx> Cc: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx> Cc: Petr Mladek <pmladek@xxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/kernel/panic.c~taint-fix-debugfs_simple_attrcocci-warnings +++ a/kernel/panic.c @@ -642,16 +642,14 @@ static int clear_warn_once_set(void *dat return 0; } -DEFINE_SIMPLE_ATTRIBUTE(clear_warn_once_fops, - NULL, - clear_warn_once_set, - "%lld\n"); +DEFINE_DEBUGFS_ATTRIBUTE(clear_warn_once_fops, NULL, clear_warn_once_set, + "%lld\n"); static __init int register_warn_debugfs(void) { /* Don't care about failure */ - debugfs_create_file("clear_warn_once", 0200, NULL, - NULL, &clear_warn_once_fops); + debugfs_create_file_unsafe("clear_warn_once", 0200, NULL, NULL, + &clear_warn_once_fops); return 0; } _ Patches currently in -mm which might be from yuehaibing@xxxxxxxxxx are sh-kfr2r09-drop-pointless-static-qualifier-in-kfr2r09_usb0_gadget_setup.patch mm-hmm-remove-set-but-not-used-variable-devmem.patch mm-mark-stack_vm_area-with-__maybe_unused.patch taint-fix-debugfs_simple_attrcocci-warnings.patch fork-remove-duplicated-include-from-forkc.patch