From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Tejun Heo <htejun@gmail.com>
Cc: Gabriel C <nix.or.die@googlemail.com>,
Satyam Sharma <satyam.sharma@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Christoph Lameter <clameter@sgi.com>,
gregkh@suse.de, miles.lane@gmail.com
Subject: Re: [PATCH] sysfs: cosmetic clean up on node creation failure paths
Date: Wed, 18 Jul 2007 13:40:13 +0200 [thread overview]
Message-ID: <20070718134013.057e4755@gondolin.boeblingen.de.ibm.com> (raw)
In-Reply-To: <20070718073811.GA22374@htj.dyndns.org>
On Wed, 18 Jul 2007 16:38:11 +0900,
Tejun Heo <htejun@gmail.com> wrote:
> Node addition failure is detected by testing return value of
> sysfs_addfm_finish() which returns the number of added and removed
> nodes. As the function is called as the last step of addition right
> on top of error handling block, the if blocks looked like the
> following.
>
> if (sysfs_addrm_finish(&acxt))
> success handling, usually return;
> /* fall through to error handling */
>
> This is the opposite of usual convention in sysfs and makes the code
> difficult to understand. This patch inverts the test and makes those
> blocks look more like others.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
> fs/sysfs/dir.c | 12 +++++++-----
> fs/sysfs/file.c | 9 +++++----
> fs/sysfs/symlink.c | 10 ++++++----
> 3 files changed, 18 insertions(+), 13 deletions(-)
Looks nice. One thing, though:
sysfs_hash_and_remove() has the same check, but without a cleanup
section. This should follow the (!sysfs_addrm_finish()) pattern as well
(makes pattern matching easier when reading the code).
next prev parent reply other threads:[~2007-07-18 11:40 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-14 12:18 Oops while modprobing phy fixed module Gabriel C
2007-07-14 12:44 ` Gabriel C
2007-07-15 5:39 ` Satyam Sharma
2007-07-15 17:42 ` Gabriel C
2007-07-15 20:32 ` Gabriel C
2007-07-15 21:14 ` Satyam Sharma
2007-07-15 22:19 ` Gabriel C
2007-07-16 12:17 ` Gabriel C
2007-07-16 15:19 ` Satyam Sharma
2007-07-16 15:41 ` Gabriel C
2007-07-16 16:18 ` Gabriel C
2007-07-16 16:54 ` Gabriel C
2007-07-16 18:23 ` Tejun Heo
2007-07-16 18:32 ` Gabriel C
2007-07-16 19:11 ` Gabriel C
2007-07-16 19:13 ` Gabriel C
2007-07-18 5:51 ` Tejun Heo
2007-07-23 19:53 ` Christoph Lameter
2007-07-24 6:35 ` Tejun Heo
2007-07-18 7:14 ` [PATCH] sysfs: kill an extra put in sysfs_create_link() failure path Tejun Heo
2007-07-18 7:38 ` [PATCH] sysfs: cosmetic clean up on node creation failure paths Tejun Heo
2007-07-18 11:40 ` Cornelia Huck [this message]
2007-07-18 11:16 ` [PATCH] sysfs: kill an extra put in sysfs_create_link() failure path Cornelia Huck
2007-07-18 14:29 ` Miles Lane
2007-07-18 14:48 ` Satyam Sharma
2007-07-18 14:57 ` Tejun Heo
2007-07-18 15:16 ` Satyam Sharma
2007-07-18 15:30 ` Satyam Sharma
2007-07-18 15:53 ` Tejun Heo
2007-07-18 16:08 ` Satyam Sharma
2007-07-18 16:20 ` Tejun Heo
2007-07-18 15:43 ` Tejun Heo
2007-07-18 16:06 ` Satyam Sharma
2007-07-18 16:30 ` Tejun Heo
2007-07-18 16:36 ` Satyam Sharma
2007-07-18 16:41 ` Tejun Heo
2007-07-18 16:49 ` Satyam Sharma
2007-07-18 16:59 ` Miles Lane
2007-07-23 19:52 ` Oops while modprobing phy fixed module Christoph Lameter
2007-07-16 17:43 ` Vitaly Bordug
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=20070718134013.057e4755@gondolin.boeblingen.de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=clameter@sgi.com \
--cc=gregkh@suse.de \
--cc=htejun@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=miles.lane@gmail.com \
--cc=nix.or.die@googlemail.com \
--cc=satyam.sharma@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®