Skip to content

Commit 4981e01

Browse files
miquelraynalgregkh
authored andcommitted
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 <[email protected]> Message-ID: <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 39d4225 commit 4981e01

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/sysfs/group.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@ static int internal_create_group(struct kobject *kobj, int update,
142142
return PTR_ERR(kn);
143143
}
144144
}
145-
} else
145+
} else {
146146
kn = kobj->sd;
147+
}
148+
147149
kernfs_get(kn);
148150
error = create_files(kn, kobj, uid, gid, grp, update);
149151
if (error) {

0 commit comments

Comments
 (0)