linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: + taint-fix-debugfs_simple_attrcocci-warnings.patch added to -mm tree
       [not found] <20181228215406.5_p7tLTSr%akpm@linux-foundation.org>
@ 2018-12-30  4:02 ` Sergey Senozhatsky
  0 siblings, 0 replies; only message in thread
From: Sergey Senozhatsky @ 2018-12-30  4:02 UTC (permalink / raw)
  To: akpm
  Cc: bp, keescook, mm-commits, pmladek, rostedt,
	sergey.senozhatsky.work, yuehaibing, linux-kernel

On (12/28/18 13:54), akpm@linux-foundation.org wrote:
>
> 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().

Looks OK to me.

Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>

>  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;
>  }

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-12-30  4:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20181228215406.5_p7tLTSr%akpm@linux-foundation.org>
2018-12-30  4:02 ` + taint-fix-debugfs_simple_attrcocci-warnings.patch added to -mm tree Sergey Senozhatsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).