All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Luigi Rizzo <lrizzo@google.com>
Cc: linux-kernel@vger.kernel.org, mhiramat@kernel.org,
	akpm@linux-foundation.org, naveen.n.rao@linux.ibm.com,
	changbin.du@intel.com, ardb@kernel.org, rizzo@iet.unipi.it,
	pabeni@redhat.com, toke@redhat.com, hawk@kernel.org
Subject: Re: [PATCH 1/2] quickstats, kernel sample collector
Date: Wed, 26 Feb 2020 09:12:11 +0100	[thread overview]
Message-ID: <20200226081211.GD22801@kroah.com> (raw)
In-Reply-To: <20200226023027.218365-2-lrizzo@google.com>

On Tue, Feb 25, 2020 at 06:30:26PM -0800, Luigi Rizzo wrote:
> +static int __init ks_init(void)
> +{
> +	ks_root = debugfs_create_dir("kstats", NULL);
> +	if (IS_ERR_OR_NULL(ks_root)) {
> +		pr_warn("kstats: cannot create debugfs root\n");
> +		return PTR_ERR(ks_root);
> +	}

Do not check debugfs_create_* calls as there is no need to.  Just take
the return value (if you care to use it again) and move on.

Also, the check you made here is incorrect :)

> +	ks_control_dentry = debugfs_create_file("_control", 0644, ks_root,
> +						NULL, &ks_file_ops);
> +	if (IS_ERR_OR_NULL(ks_control_dentry)) {
> +		pr_warn("kstats: cannot create kstats/_control\n");
> +		debugfs_remove_recursive(ks_root);
> +		return PTR_ERR(ks_control_dentry);
> +	}

Same here, just call debugfs_create_file and move on.

You do this same thing in other places too.

thanks,

greg k-h

  parent reply	other threads:[~2020-02-26  8:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26  2:30 [PATCH 0/2] quickstats, kernel sample collector Luigi Rizzo
2020-02-26  2:30 ` [PATCH 1/2] " Luigi Rizzo
2020-02-26  4:26   ` Randy Dunlap
2020-02-26  6:08   ` kbuild test robot
2020-02-26  6:08     ` kbuild test robot
2020-02-26  8:12   ` Greg KH [this message]
2020-02-26  2:30 ` [PATCH 2/2] quickstats: user commands to trace execution time of code Luigi Rizzo
2020-02-26  8:10 ` [PATCH 0/2] quickstats, kernel sample collector Greg KH
2020-02-26  9:52   ` Luigi Rizzo
2020-02-26 10:14     ` Greg KH
2020-02-26 11:40       ` Luigi Rizzo
2020-02-26 16:57         ` Greg KH

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=20200226081211.GD22801@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=changbin.du@intel.com \
    --cc=hawk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrizzo@google.com \
    --cc=mhiramat@kernel.org \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=pabeni@redhat.com \
    --cc=rizzo@iet.unipi.it \
    --cc=toke@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.