From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Luka Perkov <luka.perkov@sartura.hr>,
Robert Marko <robert.marko@sartura.hr>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
<linux-kernel@vger.kernel.org>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Rafael J Wysocki <rafael@kernel.org>,
Miquel Raynal <miquel.raynal@bootlin.com>
Subject: [PATCH v3 1/4] sysfs: Improve readability by following the kernel coding style
Date: Mon, 5 Jun 2023 15:34:19 +0200 [thread overview]
Message-ID: <20230605133422.45840-2-miquel.raynal@bootlin.com> (raw)
In-Reply-To: <20230605133422.45840-1-miquel.raynal@bootlin.com>
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>
---
fs/sysfs/group.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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) {
--
2.34.1
next prev parent reply other threads:[~2023-06-05 13:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-05 13:34 [PATCH v3 0/4] NVMEM cells in sysfs Miquel Raynal
2023-06-05 13:34 ` Miquel Raynal [this message]
2023-06-05 13:34 ` [PATCH v3 2/4] sysfs: Skip empty folders creation Miquel Raynal
2023-06-05 13:34 ` [PATCH v3 3/4] ABI: sysfs-nvmem-cells: Expose cells through sysfs Miquel Raynal
2023-06-05 13:34 ` [PATCH v3 4/4] nvmem: core: " Miquel Raynal
2023-06-06 10:31 ` Srinivas Kandagatla
2023-06-09 16:05 ` Miquel Raynal
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=20230605133422.45840-2-miquel.raynal@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luka.perkov@sartura.hr \
--cc=rafael@kernel.org \
--cc=robert.marko@sartura.hr \
--cc=srinivas.kandagatla@linaro.org \
--cc=thomas.petazzoni@bootlin.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®