From: Artem Bityutskiy <dedekind1@gmail.com>
To: Phil Carmody <ext-phil.2.carmody@nokia.com>
Cc: linux-mtd@lists.infradead.org, adrian.hunter@nokia.com
Subject: Re: [PATCH 1/1] ubifs: debugfs operations may return both ERRs and NULLs
Date: Mon, 28 Mar 2011 15:10:32 +0300 [thread overview]
Message-ID: <1301314232.2816.40.camel@localhost> (raw)
In-Reply-To: <20110328103816.GC2072@esdhcp04044.research.nokia.com>
On Mon, 2011-03-28 at 13:38 +0300, Phil Carmody wrote:
> > I think the right fix would be to fix debugfs and return an error code
> > in any case.
>
> Agree. Alas it might require hitting a lot of both active and dead code.
> Is that something you want me to look at? If you do it yourself, please
> Cc: me, I'll happily review it.
No, I do not ask you do change debugfs. Do it only if you fare feeling
enthusiastic about this :-) But I do not feel that way, so won't delve
into the debugfs story :-)
All I mean is that we should not do this:
- if (IS_ERR(ptr)) {
+ if (IS_ERR_OR_NULL(ptr))
- int err = PTR_ERR(ptr);
- return err;
+ return -ENODEV;
But rather
- if (IS_ERR(ptr)) {
+ if (IS_ERR_OR_NULL(ptr)) {
- int err = PTR_ERR(ptr);
+ int err = ptr ? PTR_ERR(ptr) : -ENODEV;
return err;
or something like this.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
next prev parent reply other threads:[~2011-03-28 12:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-23 9:51 [PATCH 1/1] ubifs: debugfs operations may return both ERRs and NULLs Phil Carmody
2011-03-23 12:41 ` Artem Bityutskiy
2011-03-23 13:16 ` Phil Carmody
2011-03-23 13:35 ` Phil Carmody
2011-03-28 6:51 ` Artem Bityutskiy
2011-03-28 10:38 ` Phil Carmody
2011-03-28 12:10 ` Artem Bityutskiy [this message]
2011-03-23 13:18 ` Artem Bityutskiy
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=1301314232.2816.40.camel@localhost \
--to=dedekind1@gmail.com \
--cc=adrian.hunter@nokia.com \
--cc=ext-phil.2.carmody@nokia.com \
--cc=linux-mtd@lists.infradead.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