summaryrefslogtreecommitdiff
path: root/fs/sysfs
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2023-06-14 09:30:15 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-15 14:37:50 +0300
commit4981e0139feeadb1cdffd43a203543afe20769fa (patch)
treec6e83ed71cb48dd80fcc1d92d2ed167d1f11836c /fs/sysfs
parent39d422555e43379516d4d13f5b7162a3dee6e646 (diff)
downloadlinux-4981e0139feeadb1cdffd43a203543afe20769fa.tar.xz
sysfs: Improve readability by following the kernel coding style
The purpose of the if/else block is to select the right sysfs directory entry to be used for the files creation. At a first look when you have the file in front of you, it really seems like the "create_files()" lines right after the block are badly indented and the "else" does not guard. In practice the code is correct but lacks curly brackets to show where the big if/else block actually ends. Add these brackets to comply with the current kernel coding style and to ease the understanding of the whole logic. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Message-ID: <20230614063018.2419043-2-miquel.raynal@bootlin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/group.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c
index eeb0e3099421..990309132c93 100644
--- a/fs/sysfs/group.c
+++ b/fs/sysfs/group.c
@@ -142,8 +142,10 @@ static int internal_create_group(struct kobject *kobj, int update,
return PTR_ERR(kn);
}
}
- } else
+ } else {
kn = kobj->sd;
+ }
+
kernfs_get(kn);
error = create_files(kn, kobj, uid, gid, grp, update);
if (error) {