* [PATCH] bus: sunxi-rsb: make sunxi_rsb_bus const
@ 2024-02-04 15:56 Ricardo B. Marliere
2024-02-05 12:50 ` Greg Kroah-Hartman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 15:56 UTC (permalink / raw)
To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
Cc: linux-arm-kernel, linux-sunxi, linux-kernel, Greg Kroah-Hartman,
Ricardo B. Marliere
Now that the driver core can properly handle constant struct bus_type,
move the sunxi_rsb_bus variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
drivers/bus/sunxi-rsb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c
index fd3e9d82340a..1e29ba76615d 100644
--- a/drivers/bus/sunxi-rsb.c
+++ b/drivers/bus/sunxi-rsb.c
@@ -128,7 +128,7 @@ struct sunxi_rsb {
};
/* bus / slave device related functions */
-static struct bus_type sunxi_rsb_bus;
+static const struct bus_type sunxi_rsb_bus;
static int sunxi_rsb_device_match(struct device *dev, struct device_driver *drv)
{
@@ -177,7 +177,7 @@ static int sunxi_rsb_device_modalias(const struct device *dev, struct kobj_ueven
return of_device_uevent_modalias(dev, env);
}
-static struct bus_type sunxi_rsb_bus = {
+static const struct bus_type sunxi_rsb_bus = {
.name = RSB_CTRL_NAME,
.match = sunxi_rsb_device_match,
.probe = sunxi_rsb_device_probe,
---
base-commit: 38ed19495066966979ba821b9e0f549ad5ea620d
change-id: 20240204-bus_cleanup-bus-de90b25d7ce6
Best regards,
--
Ricardo B. Marliere <ricardo@marliere.net>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] bus: sunxi-rsb: make sunxi_rsb_bus const
2024-02-04 15:56 [PATCH] bus: sunxi-rsb: make sunxi_rsb_bus const Ricardo B. Marliere
@ 2024-02-05 12:50 ` Greg Kroah-Hartman
2024-02-05 18:14 ` Jernej Škrabec
2024-02-11 20:25 ` Jernej Škrabec
2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-05 12:50 UTC (permalink / raw)
To: Ricardo B. Marliere
Cc: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, linux-arm-kernel,
linux-sunxi, linux-kernel
On Sun, Feb 04, 2024 at 12:56:44PM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the sunxi_rsb_bus variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] bus: sunxi-rsb: make sunxi_rsb_bus const
2024-02-04 15:56 [PATCH] bus: sunxi-rsb: make sunxi_rsb_bus const Ricardo B. Marliere
2024-02-05 12:50 ` Greg Kroah-Hartman
@ 2024-02-05 18:14 ` Jernej Škrabec
2024-02-11 20:25 ` Jernej Škrabec
2 siblings, 0 replies; 4+ messages in thread
From: Jernej Škrabec @ 2024-02-05 18:14 UTC (permalink / raw)
To: Chen-Yu Tsai, Samuel Holland, Ricardo B. Marliere
Cc: linux-arm-kernel, linux-sunxi, linux-kernel, Greg Kroah-Hartman,
Ricardo B. Marliere
Dne nedelja, 04. februar 2024 ob 16:56:44 CET je Ricardo B. Marliere napisal(a):
> Now that the driver core can properly handle constant struct bus_type,
> move the sunxi_rsb_bus variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> ---
> drivers/bus/sunxi-rsb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c
> index fd3e9d82340a..1e29ba76615d 100644
> --- a/drivers/bus/sunxi-rsb.c
> +++ b/drivers/bus/sunxi-rsb.c
> @@ -128,7 +128,7 @@ struct sunxi_rsb {
> };
>
> /* bus / slave device related functions */
> -static struct bus_type sunxi_rsb_bus;
> +static const struct bus_type sunxi_rsb_bus;
>
> static int sunxi_rsb_device_match(struct device *dev, struct device_driver *drv)
> {
> @@ -177,7 +177,7 @@ static int sunxi_rsb_device_modalias(const struct device *dev, struct kobj_ueven
> return of_device_uevent_modalias(dev, env);
> }
>
> -static struct bus_type sunxi_rsb_bus = {
> +static const struct bus_type sunxi_rsb_bus = {
> .name = RSB_CTRL_NAME,
> .match = sunxi_rsb_device_match,
> .probe = sunxi_rsb_device_probe,
>
> ---
> base-commit: 38ed19495066966979ba821b9e0f549ad5ea620d
> change-id: 20240204-bus_cleanup-bus-de90b25d7ce6
>
> Best regards,
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] bus: sunxi-rsb: make sunxi_rsb_bus const
2024-02-04 15:56 [PATCH] bus: sunxi-rsb: make sunxi_rsb_bus const Ricardo B. Marliere
2024-02-05 12:50 ` Greg Kroah-Hartman
2024-02-05 18:14 ` Jernej Škrabec
@ 2024-02-11 20:25 ` Jernej Škrabec
2 siblings, 0 replies; 4+ messages in thread
From: Jernej Škrabec @ 2024-02-11 20:25 UTC (permalink / raw)
To: Chen-Yu Tsai, Samuel Holland, Ricardo B. Marliere
Cc: linux-arm-kernel, linux-sunxi, linux-kernel, Greg Kroah-Hartman,
Ricardo B. Marliere
Dne nedelja, 04. februar 2024 ob 16:56:44 CET je Ricardo B. Marliere napisal(a):
> Now that the driver core can properly handle constant struct bus_type,
> move the sunxi_rsb_bus variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Applied, thanks!
Best regards,
Jernej
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-02-11 20:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-04 15:56 [PATCH] bus: sunxi-rsb: make sunxi_rsb_bus const Ricardo B. Marliere
2024-02-05 12:50 ` Greg Kroah-Hartman
2024-02-05 18:14 ` Jernej Škrabec
2024-02-11 20:25 ` Jernej Škrabec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).