+ taint-fix-debugfs_simple_attrcocci-warnings.patch added to -mm tree
A message that is not in the archive (sent off-list or not yet received): 20181228215406.5_p7tLTSr%[email protected]
Sergey Senozhatsky
Reviewed-byQuoted 8 lines · On (12/28/18 13:54), [email protected] wrote:
Use
DEFINE_DEBUGFS_ATTRIBUTErather thanDEFINE_SIMPLE_ATTRIBUTEfor debugfs files.Semantic patch information:
Rationale:DEFINE_SIMPLE_ATTRIBUTE+debugfs_create_file()imposes some significant overhead as compared toDEFINE_DEBUGFS_ATTRIBUTE+debugfs_create_file_unsafe().
Looks OK to me.
Review
Quoted 9 lines
static
__initintregister_warn_debugfs(void)
{(quoted diff) +2
-2/* 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; }
The commit message probably can be better.
The _unsafe() part suggests that some of them "safeness responsibilities" are now panic.c responsibilities. The patch is OK since panic's clear_warn_once_fops struct file_operations is safe against removal, so we don't have to use otherwise necessary debugfs_file_get()/debugfs_file_put().
-ss