* [PATCH RESEND] firmware: turris-mox-rwtm: make kobj_type structure constant
@ 2023-03-24 16:27 Thomas Weißschuh
2023-03-26 12:58 ` Marek Behún
2023-04-07 15:18 ` Gregory CLEMENT
0 siblings, 2 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2023-03-24 16:27 UTC (permalink / raw)
To: Marek Behún, Gregory CLEMENT; +Cc: linux-kernel, 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 definition to prevent
modification at runtime.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
drivers/firmware/turris-mox-rwtm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c
index 6ea5789a89e2..2de0fb139ce1 100644
--- a/drivers/firmware/turris-mox-rwtm.c
+++ b/drivers/firmware/turris-mox-rwtm.c
@@ -104,7 +104,7 @@ static void mox_kobj_release(struct kobject *kobj)
kfree(to_rwtm(kobj)->kobj);
}
-static struct kobj_type mox_kobj_ktype = {
+static const struct kobj_type mox_kobj_ktype = {
.release = mox_kobj_release,
.sysfs_ops = &kobj_sysfs_ops,
};
---
base-commit: 2fcd07b7ccd5fd10b2120d298363e4e6c53ccf9c
change-id: 20230227-kobj_type-firmware-turris-6cd4a66bac19
Best regards,
--
Thomas Weißschuh <linux@weissschuh.net>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH RESEND] firmware: turris-mox-rwtm: make kobj_type structure constant
2023-03-24 16:27 [PATCH RESEND] firmware: turris-mox-rwtm: make kobj_type structure constant Thomas Weißschuh
@ 2023-03-26 12:58 ` Marek Behún
2023-03-27 0:06 ` Thomas Weißschuh
2023-04-07 15:18 ` Gregory CLEMENT
1 sibling, 1 reply; 4+ messages in thread
From: Marek Behún @ 2023-03-26 12:58 UTC (permalink / raw)
To: Thomas Weißschuh; +Cc: Gregory CLEMENT, linux-kernel
Didn't I already give reviewed-by tag?
Reviewed-by: Marek Behún <kabel@kernel.org>
On Fri, Mar 24, 2023 at 04:27:50PM +0000, Thomas Weißschuh wrote:
> 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 definition to prevent
> modification at runtime.
>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
> drivers/firmware/turris-mox-rwtm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c
> index 6ea5789a89e2..2de0fb139ce1 100644
> --- a/drivers/firmware/turris-mox-rwtm.c
> +++ b/drivers/firmware/turris-mox-rwtm.c
> @@ -104,7 +104,7 @@ static void mox_kobj_release(struct kobject *kobj)
> kfree(to_rwtm(kobj)->kobj);
> }
>
> -static struct kobj_type mox_kobj_ktype = {
> +static const struct kobj_type mox_kobj_ktype = {
> .release = mox_kobj_release,
> .sysfs_ops = &kobj_sysfs_ops,
> };
>
> ---
> base-commit: 2fcd07b7ccd5fd10b2120d298363e4e6c53ccf9c
> change-id: 20230227-kobj_type-firmware-turris-6cd4a66bac19
>
> Best regards,
> --
> Thomas Weißschuh <linux@weissschuh.net>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH RESEND] firmware: turris-mox-rwtm: make kobj_type structure constant
2023-03-26 12:58 ` Marek Behún
@ 2023-03-27 0:06 ` Thomas Weißschuh
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2023-03-27 0:06 UTC (permalink / raw)
To: Marek Behún; +Cc: Gregory CLEMENT, linux-kernel
Hi Marek,
On 2023-03-26 14:58:16+0200, Marek Behún wrote:
> Didn't I already give reviewed-by tag?
Yes indeed. Sorry for that oversight.
> Reviewed-by: Marek Behún <kabel@kernel.org>
>
> On Fri, Mar 24, 2023 at 04:27:50PM +0000, Thomas Weißschuh wrote:
> > 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 definition to prevent
> > modification at runtime.
> >
> > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> > ---
> > drivers/firmware/turris-mox-rwtm.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH RESEND] firmware: turris-mox-rwtm: make kobj_type structure constant
2023-03-24 16:27 [PATCH RESEND] firmware: turris-mox-rwtm: make kobj_type structure constant Thomas Weißschuh
2023-03-26 12:58 ` Marek Behún
@ 2023-04-07 15:18 ` Gregory CLEMENT
1 sibling, 0 replies; 4+ messages in thread
From: Gregory CLEMENT @ 2023-04-07 15:18 UTC (permalink / raw)
To: Thomas Weißschuh, Marek Behún
Cc: linux-kernel, Thomas Weißschuh
Thomas Weißschuh <linux@weissschuh.net> writes:
> 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 definition to prevent
> modification at runtime.
>
Applied on mvebu/arm64
Thanks,
Gregory
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
> drivers/firmware/turris-mox-rwtm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c
> index 6ea5789a89e2..2de0fb139ce1 100644
> --- a/drivers/firmware/turris-mox-rwtm.c
> +++ b/drivers/firmware/turris-mox-rwtm.c
> @@ -104,7 +104,7 @@ static void mox_kobj_release(struct kobject *kobj)
> kfree(to_rwtm(kobj)->kobj);
> }
>
> -static struct kobj_type mox_kobj_ktype = {
> +static const struct kobj_type mox_kobj_ktype = {
> .release = mox_kobj_release,
> .sysfs_ops = &kobj_sysfs_ops,
> };
>
> ---
> base-commit: 2fcd07b7ccd5fd10b2120d298363e4e6c53ccf9c
> change-id: 20230227-kobj_type-firmware-turris-6cd4a66bac19
>
> Best regards,
> --
> Thomas Weißschuh <linux@weissschuh.net>
>
--
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-04-07 15:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 16:27 [PATCH RESEND] firmware: turris-mox-rwtm: make kobj_type structure constant Thomas Weißschuh
2023-03-26 12:58 ` Marek Behún
2023-03-27 0:06 ` Thomas Weißschuh
2023-04-07 15:18 ` Gregory CLEMENT
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.