From: Amit Shah <amit.shah@redhat.com>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] virtio_console: correct error message on failure of debugfs_create_dir
Date: Fri, 21 Dec 2012 13:29:09 +0530 [thread overview]
Message-ID: <20121221075909.GA15739@amit.redhat.com> (raw)
In-Reply-To: <1356030701-16284-13-git-send-email-sasha.levin@oracle.com>
On (Thu) 20 Dec 2012 [14:11:21], Sasha Levin wrote:
> debugfs_create_dir() returns NULL if it fails, there's little point in
> calling PTR_ERR on it.
>
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
> ---
> drivers/char/virtio_console.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
> index c594cb1..490b70e 100644
> --- a/drivers/char/virtio_console.c
> +++ b/drivers/char/virtio_console.c
> @@ -2212,10 +2212,9 @@ static int __init init(void)
> }
>
> pdrvdata.debugfs_dir = debugfs_create_dir("virtio-ports", NULL);
> - if (!pdrvdata.debugfs_dir) {
> - pr_warning("Error %ld creating debugfs dir for virtio-ports\n",
> - PTR_ERR(pdrvdata.debugfs_dir));
> - }
> + if (!pdrvdata.debugfs_dir)
> + pr_warn("Error creating debugfs dir for virtio-ports\n");
debugfs_create_dir() does return an error value if debugfs is not
enabled.
This check for !pdrvdata.debugfs_dir should infact use
IS_ERR_OR_NULL(). Care to submit a patch for that?
Amit
next prev parent reply other threads:[~2012-12-21 7:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1356030701-16284-1-git-send-email-sasha.levin@oracle.com>
2012-12-20 19:11 ` [PATCH] virtio_console: correct error message on failure of debugfs_create_dir Sasha Levin
[not found] ` <1356030701-16284-13-git-send-email-sasha.levin@oracle.com>
2012-12-21 7:59 ` Amit Shah [this message]
2012-12-24 11:55 ` Arnd Bergmann
[not found] ` <201212241155.46866.arnd@arndb.de>
2012-12-24 17:39 ` Greg Kroah-Hartman
2012-12-24 18:24 ` Sasha Levin
2012-12-24 18:43 ` Greg Kroah-Hartman
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=20121221075909.GA15739@amit.redhat.com \
--to=amit.shah@redhat.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sasha.levin@oracle.com \
--cc=virtualization@lists.linux-foundation.org \
/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