public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] drivers: scsi: struct bus_type cleanup
@ 2024-02-03 18:38 Ricardo B. Marliere
  2024-02-03 18:39 ` [PATCH 1/3] scsi: fcoe: make fcoe_bus_type const Ricardo B. Marliere
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Ricardo B. Marliere @ 2024-02-03 18:38 UTC (permalink / raw)
  To: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen,
	Lee Duncan, Chris Leech, Mike Christie
  Cc: linux-scsi, linux-kernel, open-iscsi, Greg Kroah-Hartman,
	Ricardo B. Marliere

This series is part of an effort to cleanup the users of the driver
core, as can be seen in many recent patches authored by Greg across the
tree (e.g. [1]). Specifically, this series is part of the task of
splitting one of his TODOs [2].

---
[1]: https://lore.kernel.org/lkml/?q=f%3Agregkh%40linuxfoundation.org+s%3A%22make%22+and+s%3A%22const%22
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=bus_cleanup&id=26105f537f0c60eacfeb430abd2e05d7ddcdd8aa

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>

---
Ricardo B. Marliere (3):
      scsi: fcoe: make fcoe_bus_type const
      scsi: iscsi: make iscsi_flashnode_bus const
      scsi: scsi_debug: make pseudo_lld_bus const

 drivers/scsi/fcoe/fcoe_sysfs.c      | 4 ++--
 drivers/scsi/scsi_debug.c           | 4 ++--
 drivers/scsi/scsi_transport_iscsi.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
---
base-commit: 890d900e7fec7f7956c26bd47b4f0f07a0a507b1
change-id: 20240203-bus_cleanup-scsi-7c22edb73af4

Best regards,
-- 
Ricardo B. Marliere <ricardo@marliere.net>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] scsi: fcoe: make fcoe_bus_type const
  2024-02-03 18:38 [PATCH 0/3] drivers: scsi: struct bus_type cleanup Ricardo B. Marliere
@ 2024-02-03 18:39 ` Ricardo B. Marliere
  2024-02-03 18:39 ` [PATCH 2/3] scsi: iscsi: make iscsi_flashnode_bus const Ricardo B. Marliere
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Ricardo B. Marliere @ 2024-02-03 18:39 UTC (permalink / raw)
  To: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen,
	Lee Duncan, Chris Leech, Mike Christie
  Cc: linux-scsi, linux-kernel, open-iscsi, Greg Kroah-Hartman,
	Ricardo B. Marliere

Now that the driver core can properly handle constant struct bus_type,
move the fcoe_bus_type 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/scsi/fcoe/fcoe_sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
index c64a085a7ee2..453665ac6020 100644
--- a/drivers/scsi/fcoe/fcoe_sysfs.c
+++ b/drivers/scsi/fcoe/fcoe_sysfs.c
@@ -597,7 +597,7 @@ static const struct attribute_group *fcoe_fcf_attr_groups[] = {
 	NULL,
 };
 
-static struct bus_type fcoe_bus_type;
+static const struct bus_type fcoe_bus_type;
 
 static int fcoe_bus_match(struct device *dev,
 			  struct device_driver *drv)
@@ -664,7 +664,7 @@ static struct attribute *fcoe_bus_attrs[] = {
 };
 ATTRIBUTE_GROUPS(fcoe_bus);
 
-static struct bus_type fcoe_bus_type = {
+static const struct bus_type fcoe_bus_type = {
 	.name = "fcoe",
 	.match = &fcoe_bus_match,
 	.bus_groups = fcoe_bus_groups,

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] scsi: iscsi: make iscsi_flashnode_bus const
  2024-02-03 18:38 [PATCH 0/3] drivers: scsi: struct bus_type cleanup Ricardo B. Marliere
  2024-02-03 18:39 ` [PATCH 1/3] scsi: fcoe: make fcoe_bus_type const Ricardo B. Marliere
@ 2024-02-03 18:39 ` Ricardo B. Marliere
  2024-02-03 21:12   ` Lee Duncan
  2024-02-03 18:39 ` [PATCH 3/3] scsi: scsi_debug: make pseudo_lld_bus const Ricardo B. Marliere
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 8+ messages in thread
From: Ricardo B. Marliere @ 2024-02-03 18:39 UTC (permalink / raw)
  To: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen,
	Lee Duncan, Chris Leech, Mike Christie
  Cc: linux-scsi, linux-kernel, open-iscsi, Greg Kroah-Hartman,
	Ricardo B. Marliere

Now that the driver core can properly handle constant struct bus_type,
move the iscsi_flashnode_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/scsi/scsi_transport_iscsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 3075b2ddf7a6..af3ac6346796 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -1201,7 +1201,7 @@ static const struct device_type iscsi_flashnode_conn_dev_type = {
 	.release = iscsi_flashnode_conn_release,
 };
 
-static struct bus_type iscsi_flashnode_bus;
+static const struct bus_type iscsi_flashnode_bus;
 
 int iscsi_flashnode_bus_match(struct device *dev,
 				     struct device_driver *drv)
@@ -1212,7 +1212,7 @@ int iscsi_flashnode_bus_match(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(iscsi_flashnode_bus_match);
 
-static struct bus_type iscsi_flashnode_bus = {
+static const struct bus_type iscsi_flashnode_bus = {
 	.name = "iscsi_flashnode",
 	.match = &iscsi_flashnode_bus_match,
 };

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] scsi: scsi_debug: make pseudo_lld_bus const
  2024-02-03 18:38 [PATCH 0/3] drivers: scsi: struct bus_type cleanup Ricardo B. Marliere
  2024-02-03 18:39 ` [PATCH 1/3] scsi: fcoe: make fcoe_bus_type const Ricardo B. Marliere
  2024-02-03 18:39 ` [PATCH 2/3] scsi: iscsi: make iscsi_flashnode_bus const Ricardo B. Marliere
@ 2024-02-03 18:39 ` Ricardo B. Marliere
  2024-02-03 21:23 ` [PATCH 0/3] drivers: scsi: struct bus_type cleanup Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Ricardo B. Marliere @ 2024-02-03 18:39 UTC (permalink / raw)
  To: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen,
	Lee Duncan, Chris Leech, Mike Christie
  Cc: linux-scsi, linux-kernel, open-iscsi, Greg Kroah-Hartman,
	Ricardo B. Marliere

Now that the driver core can properly handle constant struct bus_type,
move the pseudo_lld_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/scsi/scsi_debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index d03d66f11493..914d9c12e741 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -899,7 +899,7 @@ static int poll_queues; /* iouring iopoll interface.*/
 static char sdebug_proc_name[] = MY_NAME;
 static const char *my_name = MY_NAME;
 
-static struct bus_type pseudo_lld_bus;
+static const struct bus_type pseudo_lld_bus;
 
 static struct device_driver sdebug_driverfs_driver = {
 	.name 		= sdebug_proc_name,
@@ -8405,7 +8405,7 @@ static void sdebug_driver_remove(struct device *dev)
 	scsi_host_put(sdbg_host->shost);
 }
 
-static struct bus_type pseudo_lld_bus = {
+static const struct bus_type pseudo_lld_bus = {
 	.name = "pseudo",
 	.probe = sdebug_driver_probe,
 	.remove = sdebug_driver_remove,

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] scsi: iscsi: make iscsi_flashnode_bus const
  2024-02-03 18:39 ` [PATCH 2/3] scsi: iscsi: make iscsi_flashnode_bus const Ricardo B. Marliere
@ 2024-02-03 21:12   ` Lee Duncan
  0 siblings, 0 replies; 8+ messages in thread
From: Lee Duncan @ 2024-02-03 21:12 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen,
	Chris Leech, Mike Christie, linux-scsi, linux-kernel, open-iscsi,
	Greg Kroah-Hartman

On Sat, Feb 3, 2024 at 10:38 AM Ricardo B. Marliere
<ricardo@marliere.net> wrote:
>
> Now that the driver core can properly handle constant struct bus_type,
> move the iscsi_flashnode_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/scsi/scsi_transport_iscsi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
> index 3075b2ddf7a6..af3ac6346796 100644
> --- a/drivers/scsi/scsi_transport_iscsi.c
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -1201,7 +1201,7 @@ static const struct device_type iscsi_flashnode_conn_dev_type = {
>         .release = iscsi_flashnode_conn_release,
>  };
>
> -static struct bus_type iscsi_flashnode_bus;
> +static const struct bus_type iscsi_flashnode_bus;
>
>  int iscsi_flashnode_bus_match(struct device *dev,
>                                      struct device_driver *drv)
> @@ -1212,7 +1212,7 @@ int iscsi_flashnode_bus_match(struct device *dev,
>  }
>  EXPORT_SYMBOL_GPL(iscsi_flashnode_bus_match);
>
> -static struct bus_type iscsi_flashnode_bus = {
> +static const struct bus_type iscsi_flashnode_bus = {
>         .name = "iscsi_flashnode",
>         .match = &iscsi_flashnode_bus_match,
>  };
>
> --
> 2.43.0
>

Reviewed-by: Lee Duncan <lduncan@suse.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/3] drivers: scsi: struct bus_type cleanup
  2024-02-03 18:38 [PATCH 0/3] drivers: scsi: struct bus_type cleanup Ricardo B. Marliere
                   ` (2 preceding siblings ...)
  2024-02-03 18:39 ` [PATCH 3/3] scsi: scsi_debug: make pseudo_lld_bus const Ricardo B. Marliere
@ 2024-02-03 21:23 ` Greg Kroah-Hartman
  2024-02-06  2:00 ` Martin K. Petersen
  2024-02-13  1:57 ` Martin K. Petersen
  5 siblings, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-03 21:23 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen,
	Lee Duncan, Chris Leech, Mike Christie, linux-scsi, linux-kernel,
	open-iscsi

On Sat, Feb 03, 2024 at 03:38:59PM -0300, Ricardo B. Marliere wrote:
> This series is part of an effort to cleanup the users of the driver
> core, as can be seen in many recent patches authored by Greg across the
> tree (e.g. [1]). Specifically, this series is part of the task of
> splitting one of his TODOs [2].
> 
> ---
> [1]: https://lore.kernel.org/lkml/?q=f%3Agregkh%40linuxfoundation.org+s%3A%22make%22+and+s%3A%22const%22
> [2]: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=bus_cleanup&id=26105f537f0c60eacfeb430abd2e05d7ddcdd8aa
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>


Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/3] drivers: scsi: struct bus_type cleanup
  2024-02-03 18:38 [PATCH 0/3] drivers: scsi: struct bus_type cleanup Ricardo B. Marliere
                   ` (3 preceding siblings ...)
  2024-02-03 21:23 ` [PATCH 0/3] drivers: scsi: struct bus_type cleanup Greg Kroah-Hartman
@ 2024-02-06  2:00 ` Martin K. Petersen
  2024-02-13  1:57 ` Martin K. Petersen
  5 siblings, 0 replies; 8+ messages in thread
From: Martin K. Petersen @ 2024-02-06  2:00 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen,
	Lee Duncan, Chris Leech, Mike Christie, linux-scsi, linux-kernel,
	open-iscsi, Greg Kroah-Hartman


Ricardo,

> This series is part of an effort to cleanup the users of the driver
> core, as can be seen in many recent patches authored by Greg across
> the tree (e.g. [1]). Specifically, this series is part of the task of
> splitting one of his TODOs [2].

Applied to 6.9/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/3] drivers: scsi: struct bus_type cleanup
  2024-02-03 18:38 [PATCH 0/3] drivers: scsi: struct bus_type cleanup Ricardo B. Marliere
                   ` (4 preceding siblings ...)
  2024-02-06  2:00 ` Martin K. Petersen
@ 2024-02-13  1:57 ` Martin K. Petersen
  5 siblings, 0 replies; 8+ messages in thread
From: Martin K. Petersen @ 2024-02-13  1:57 UTC (permalink / raw)
  To: Hannes Reinecke, James E.J. Bottomley, Lee Duncan, Chris Leech,
	Mike Christie, Ricardo B. Marliere
  Cc: Martin K . Petersen, linux-scsi, linux-kernel, open-iscsi,
	Greg Kroah-Hartman

On Sat, 03 Feb 2024 15:38:59 -0300, Ricardo B. Marliere wrote:

> This series is part of an effort to cleanup the users of the driver
> core, as can be seen in many recent patches authored by Greg across the
> tree (e.g. [1]). Specifically, this series is part of the task of
> splitting one of his TODOs [2].
> 

Applied to 6.9/scsi-queue, thanks!

[1/3] scsi: fcoe: make fcoe_bus_type const
      https://git.kernel.org/mkp/scsi/c/4dbde797b946
[2/3] scsi: iscsi: make iscsi_flashnode_bus const
      https://git.kernel.org/mkp/scsi/c/824ec98b1b55
[3/3] scsi: scsi_debug: make pseudo_lld_bus const
      https://git.kernel.org/mkp/scsi/c/ac0dd0f33adb

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-02-13  1:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-03 18:38 [PATCH 0/3] drivers: scsi: struct bus_type cleanup Ricardo B. Marliere
2024-02-03 18:39 ` [PATCH 1/3] scsi: fcoe: make fcoe_bus_type const Ricardo B. Marliere
2024-02-03 18:39 ` [PATCH 2/3] scsi: iscsi: make iscsi_flashnode_bus const Ricardo B. Marliere
2024-02-03 21:12   ` Lee Duncan
2024-02-03 18:39 ` [PATCH 3/3] scsi: scsi_debug: make pseudo_lld_bus const Ricardo B. Marliere
2024-02-03 21:23 ` [PATCH 0/3] drivers: scsi: struct bus_type cleanup Greg Kroah-Hartman
2024-02-06  2:00 ` Martin K. Petersen
2024-02-13  1:57 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox