From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
linux-kernel@vger.kernel.org, Xuefeng Li <lixuefeng@loongson.cn>
Subject: Re: [PATCH] locking/lock_events: no need to check return value of debugfs_create functions
Date: Mon, 9 Nov 2020 11:04:09 +0100 [thread overview]
Message-ID: <20201109100409.GA1053500@kroah.com> (raw)
In-Reply-To: <ef0058d3-8308-bd9c-7289-e4009fed3b4b@loongson.cn>
On Mon, Nov 09, 2020 at 05:51:56PM +0800, Tiezhu Yang wrote:
> On 11/09/2020 04:32 PM, Peter Zijlstra wrote:
> > On Sat, Nov 07, 2020 at 05:19:13PM +0800, Tiezhu Yang 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.
> > I strongly disagree and have told this to Greg before. Having half a
> > debug interface is weird at best, so upon failure we remove the whole
> > thing, which is consistent.
>
> Hi Peter,
>
> Thanks for your reply.
>
> I find the early discussion and see the following opinion by Greg:
>
> https://lore.kernel.org/patchwork/patch/1290162/
>
> [ For debugfs, this isn't an issue, what can a user do with something like
> "debugfs isn't working? What does that mean???"
>
> And if we _really_ want warnings like this, it should go into the
> debugfs core, not require this to be done for every debugfs user, right?
The debugfs core does spit out a warning when this happens, so no need
to duplicate it in your code as well.
And for subsystems that _really_ want to check this, that's fine, it's
the minority for the whole tree, but please, document it well with a
comment on the check so that it doesn't get "cleanup" patches sent for
it in the future.
thanks,
greg k-h
prev parent reply other threads:[~2020-11-09 10:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-07 9:19 [PATCH] locking/lock_events: no need to check return value of debugfs_create functions Tiezhu Yang
2020-11-09 8:32 ` Peter Zijlstra
2020-11-09 9:51 ` Tiezhu Yang
2020-11-09 10:04 ` Greg Kroah-Hartman [this message]
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=20201109100409.GA1053500@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lixuefeng@loongson.cn \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=will@kernel.org \
--cc=yangtiezhu@loongson.cn \
/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