All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Oliver O'Halloran <oohall@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Paul Mackerras <paulus@samba.org>,
	Sukadev Bhattiprolu <sukadev@linux.ibm.com>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Anju T Sudhakar <anju@linux.vnet.ibm.com>
Subject: Re: [PATCH 6/6] powerpc: powernv: no need to check return value of debugfs_create functions
Date: Tue, 03 Mar 2020 20:52:20 +1100	[thread overview]
Message-ID: <87a74xsr3f.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <CAOSf1CEKwjDkp-=SMjmJfQirxdGCkadougZbdDS6FK1muNNCZw@mail.gmail.com>

"Oliver O'Halloran" <oohall@gmail.com> writes:
> On Mon, Feb 10, 2020 at 12:12 AM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
>>
>> When calling debugfs functions, there is no need to ever check the
>> return value.  The function can work or not, but the code logic should
>> never do something different based on this.
>
> For memtrace debugfs is the only way to actually use the feature. It'd
> be nice if it still printed out *something* if it failed to create the
> files rather than just being mysteriously absent

That's true, but the current code doesn't actually do that anyway.

>> diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platforms/powernv/memtrace.c
>> index eb2e75dac369..d6d64f8718e6 100644
>> --- a/arch/powerpc/platforms/powernv/memtrace.c
>> +++ b/arch/powerpc/platforms/powernv/memtrace.c
>> @@ -187,11 +187,6 @@ static int memtrace_init_debugfs(void)
>>
>>                 snprintf(ent->name, 16, "%08x", ent->nid);
>>                 dir = debugfs_create_dir(ent->name, memtrace_debugfs_dir);
>> -               if (!dir) {
>> -                       pr_err("Failed to create debugfs directory for node %d\n",
>> -                               ent->nid);
>> -                       return -1;
>> -               }

debugfs_create_dir() doesn't return NULL on error, it returns
ERR_PTR(-ENOMEM), which will not trigger that pr_err().

So I've merged this and if someone wants to they can send a follow-up to
do proper error checking in memtrace.c

cheers

  parent reply	other threads:[~2020-03-03 10:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-09 10:58 [PATCH 1/6] powerpc: kernel: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2020-02-09 10:58 ` [PATCH 2/6] powerpc: kvm: " Greg Kroah-Hartman
2020-02-09 10:58   ` Greg Kroah-Hartman
2020-03-03  7:46   ` Michael Ellerman
2020-03-03  7:46     ` Michael Ellerman
2020-03-03  8:50     ` Greg Kroah-Hartman
2020-03-03  8:50       ` Greg Kroah-Hartman
2020-03-03  9:45       ` Michael Ellerman
2020-03-03  9:45         ` Michael Ellerman
2020-03-03  9:58         ` Greg Kroah-Hartman
2020-03-03  9:58           ` Greg Kroah-Hartman
2020-03-03 10:32           ` Michael Ellerman
2020-03-03 10:32             ` Michael Ellerman
2020-02-09 10:58 ` [PATCH 3/6] powerpc: mm: book3s64: hash_utils: " Greg Kroah-Hartman
2020-02-09 10:58 ` [PATCH 4/6] powerpc: mm: ptdump: " Greg Kroah-Hartman
2020-02-09 10:59 ` [PATCH 5/6] powerpc: cell: axon_msi: " Greg Kroah-Hartman
2020-02-09 10:59 ` [PATCH 6/6] powerpc: powernv: " Greg Kroah-Hartman
2020-02-10 15:01   ` Oliver O'Halloran
2020-02-10 15:19     ` Greg Kroah-Hartman
2020-03-03  9:52     ` Michael Ellerman [this message]
2020-03-06  0:27 ` [PATCH 1/6] powerpc: kernel: " Michael Ellerman

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=87a74xsr3f.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=anju@linux.vnet.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=oohall@gmail.com \
    --cc=paulus@samba.org \
    --cc=sukadev@linux.ibm.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.