]> git.baikalelectronics.ru Git - kernel.git/commit
sysfs: cosmetic clean up on node creation failure paths
authorTejun Heo <htejun@gmail.com>
Wed, 18 Jul 2007 07:38:11 +0000 (16:38 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 18 Jul 2007 22:49:50 +0000 (15:49 -0700)
commit6c773d436b4d2538ce3177c8ad2033cf1bd3402d
tree218c6fc093ec110ee6f4c5d7f0aae448e5f82173
parentc447ff3141841d56961ca416deb58518a7f8c802
sysfs: cosmetic clean up on node creation failure paths

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>
Cc: Gabriel C <nix.or.die@googlemail.com>
Cc: Miles Lane <miles.lane@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/sysfs/dir.c
fs/sysfs/file.c
fs/sysfs/symlink.c