From: Dan Carpenter <dan.carpenter@oracle.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
kernel-janitors@vger.kernel.org,
Brian Norris <computersforpeace@gmail.com>,
linux-mtd@lists.infradead.org,
Akinobu Mita <akinobu.mita@gmail.com>
Subject: Re: [patch] mtd: use correct error codes in debugfs_create()
Date: Mon, 22 Jul 2013 05:56:07 +0000 [thread overview]
Message-ID: <20130722055607.GF5636@mwanda> (raw)
In-Reply-To: <20130719054938.GC9729@elgon.mountain>
On Fri, Jul 19, 2013 at 08:49:38AM +0300, Dan Carpenter wrote:
> The test here is reversed. It should be that if "dent" is a valid error
> code then we use it, otherwise if it is NULL then use -ENODEV.
>
People have explained the debugfs_create API to me better and now
I'm not sure what to do here... debugfs_create_dir() returns a
NULL on error and if debugfs is not enabled then it returns -ENODEV.
We test for if (!IS_ENABLED(CONFIG_DEBUG_FS)) earlier in the
function so it can only return NULL.
Probably I should just change the test to only test for NULL?
Otherwise I think my patch is correct. The original code will
return success on error (NULL return) and that was not intended.
regards,
dan carpenter
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
kernel-janitors@vger.kernel.org,
Brian Norris <computersforpeace@gmail.com>,
linux-mtd@lists.infradead.org,
Akinobu Mita <akinobu.mita@gmail.com>
Subject: Re: [patch] mtd: use correct error codes in debugfs_create()
Date: Mon, 22 Jul 2013 08:56:07 +0300 [thread overview]
Message-ID: <20130722055607.GF5636@mwanda> (raw)
In-Reply-To: <20130719054938.GC9729@elgon.mountain>
On Fri, Jul 19, 2013 at 08:49:38AM +0300, Dan Carpenter wrote:
> The test here is reversed. It should be that if "dent" is a valid error
> code then we use it, otherwise if it is NULL then use -ENODEV.
>
People have explained the debugfs_create API to me better and now
I'm not sure what to do here... debugfs_create_dir() returns a
NULL on error and if debugfs is not enabled then it returns -ENODEV.
We test for if (!IS_ENABLED(CONFIG_DEBUG_FS)) earlier in the
function so it can only return NULL.
Probably I should just change the test to only test for NULL?
Otherwise I think my patch is correct. The original code will
return success on error (NULL return) and that was not intended.
regards,
dan carpenter
next prev parent reply other threads:[~2013-07-22 5:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-19 5:49 [patch] mtd: use correct error codes in debugfs_create() Dan Carpenter
2013-07-19 5:49 ` Dan Carpenter
2013-07-22 5:56 ` Dan Carpenter [this message]
2013-07-22 5:56 ` Dan Carpenter
2013-07-22 7:51 ` walter harms
2013-07-22 7:51 ` walter harms
2013-07-22 12:47 ` Dan Carpenter
2013-07-22 12:47 ` Dan Carpenter
2013-07-22 20:43 ` [patch v2] mtd: tiny debugfs related fixes Dan Carpenter
2013-07-22 20:43 ` Dan Carpenter
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=20130722055607.GF5636@mwanda \
--to=dan.carpenter@oracle.com \
--cc=akinobu.mita@gmail.com \
--cc=artem.bityutskiy@linux.intel.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=kernel-janitors@vger.kernel.org \
--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 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.