public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: akpm@linux-foundation.org
Cc: bp@suse.de, keescook@chromium.org, mm-commits@vger.kernel.org,
	pmladek@suse.com, rostedt@goodmis.org,
	sergey.senozhatsky.work@gmail.com, yuehaibing@huawei.com,
	linux-kernel@vger.kernel.org
Subject: Re: + taint-fix-debugfs_simple_attrcocci-warnings.patch added to -mm tree
Date: Sun, 30 Dec 2018 13:02:44 +0900	[thread overview]
Message-ID: <20181230040244.GD5082@tigerII.localdomain> (raw)
In-Reply-To: <20181228215406.5_p7tLTSr%akpm@linux-foundation.org>

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

           reply	other threads:[~2018-12-30  4:03 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20181228215406.5_p7tLTSr%akpm@linux-foundation.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181230040244.GD5082@tigerII.localdomain \
    --to=sergey.senozhatsky@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@suse.de \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox