From: Miquel Raynal Date: Wed, 14 Jun 2023 06:30:15 +0000 (+0200) Subject: sysfs: Improve readability by following the kernel coding style X-Git-Tag: v6.5-rc1~76^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4981e0139feeadb1cdffd43a203543afe20769fa;p=thirdparty%2Fkernel%2Flinux.git 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 Message-ID: <20230614063018.2419043-2-miquel.raynal@bootlin.com> Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c index eeb0e30994215..990309132c93c 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) {