From: Zhihao Cheng <chengzhihao1@huawei.com>
To: "Thomas Weißschuh" <linux@weissschuh.net>,
"Richard Weinberger" <richard@nod.at>
Cc: <linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ubifs: make kobj_type structures constant
Date: Sat, 11 Feb 2023 15:17:11 +0800 [thread overview]
Message-ID: <a445d84b-2f08-69bf-9b23-5b5c79031d65@huawei.com> (raw)
In-Reply-To: <20230210-kobj_type-ubifs-v1-1-052419f90fae@weissschuh.net>
在 2023/2/10 10:16, Thomas Weißschuh 写道:
> Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.")
> the driver core allows the usage of const struct kobj_type.
>
> Take advantage of this to constify the structure definitions to prevent
> modification at runtime.
>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
> fs/ubifs/sysfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
> diff --git a/fs/ubifs/sysfs.c b/fs/ubifs/sysfs.c
> index 06ad8fa1fcfb..4404ca4f2ce9 100644
> --- a/fs/ubifs/sysfs.c
> +++ b/fs/ubifs/sysfs.c
> @@ -74,13 +74,13 @@ static const struct sysfs_ops ubifs_attr_ops = {
> .show = ubifs_attr_show,
> };
>
> -static struct kobj_type ubifs_sb_ktype = {
> +static const struct kobj_type ubifs_sb_ktype = {
> .default_groups = ubifs_groups,
> .sysfs_ops = &ubifs_attr_ops,
> .release = ubifs_sb_release,
> };
>
> -static struct kobj_type ubifs_ktype = {
> +static const struct kobj_type ubifs_ktype = {
> .sysfs_ops = &ubifs_attr_ops,
> };
>
>
> ---
> base-commit: e544a07438522ab3688416e6e2e34bf0ee6d8755
> change-id: 20230210-kobj_type-ubifs-5790a3d46e97
>
> Best regards,
>
prev parent reply other threads:[~2023-02-11 7:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 2:16 Thomas Weißschuh
2023-02-11 7:17 ` Zhihao Cheng [this message]
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=a445d84b-2f08-69bf-9b23-5b5c79031d65@huawei.com \
--to=chengzhihao1@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux@weissschuh.net \
--cc=richard@nod.at \
/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®