public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ata: pata_parport: make pata_parport_bus_type const
@ 2024-02-04 15:23 Ricardo B. Marliere
  2024-02-04 23:32 ` Damien Le Moal
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 15:23 UTC (permalink / raw)
  To: Damien Le Moal, Niklas Cassel
  Cc: linux-ide, linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere

Now that the driver core can properly handle constant struct bus_type,
move the pata_parport_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/ata/pata_parport/pata_parport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/pata_parport/pata_parport.c b/drivers/ata/pata_parport/pata_parport.c
index a7adfdcb5e27..9a2cb9ca9d1d 100644
--- a/drivers/ata/pata_parport/pata_parport.c
+++ b/drivers/ata/pata_parport/pata_parport.c
@@ -464,7 +464,7 @@ static void pata_parport_bus_release(struct device *dev)
 	/* nothing to do here but required to avoid warning on device removal */
 }
 
-static struct bus_type pata_parport_bus_type = {
+static const struct bus_type pata_parport_bus_type = {
 	.name = DRV_NAME,
 };
 

---
base-commit: c8474c7273ac3bad718c33118aa82efb7b374f6e
change-id: 20240204-bus_cleanup-ata-bd1625fdab09

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


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

* Re: [PATCH] ata: pata_parport: make pata_parport_bus_type const
  2024-02-04 15:23 [PATCH] ata: pata_parport: make pata_parport_bus_type const Ricardo B. Marliere
@ 2024-02-04 23:32 ` Damien Le Moal
  2024-02-05 12:51 ` Greg Kroah-Hartman
  2024-02-06  9:58 ` Niklas Cassel
  2 siblings, 0 replies; 4+ messages in thread
From: Damien Le Moal @ 2024-02-04 23:32 UTC (permalink / raw)
  To: Ricardo B. Marliere, Niklas Cassel
  Cc: linux-ide, linux-kernel, Greg Kroah-Hartman

On 2/5/24 00:23, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the pata_parport_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>

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>


-- 
Damien Le Moal
Western Digital Research


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

* Re: [PATCH] ata: pata_parport: make pata_parport_bus_type const
  2024-02-04 15:23 [PATCH] ata: pata_parport: make pata_parport_bus_type const Ricardo B. Marliere
  2024-02-04 23:32 ` Damien Le Moal
@ 2024-02-05 12:51 ` Greg Kroah-Hartman
  2024-02-06  9:58 ` Niklas Cassel
  2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-05 12:51 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Damien Le Moal, Niklas Cassel, linux-ide, linux-kernel

On Sun, Feb 04, 2024 at 12:23:29PM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the pata_parport_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>

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

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

* Re: [PATCH] ata: pata_parport: make pata_parport_bus_type const
  2024-02-04 15:23 [PATCH] ata: pata_parport: make pata_parport_bus_type const Ricardo B. Marliere
  2024-02-04 23:32 ` Damien Le Moal
  2024-02-05 12:51 ` Greg Kroah-Hartman
@ 2024-02-06  9:58 ` Niklas Cassel
  2 siblings, 0 replies; 4+ messages in thread
From: Niklas Cassel @ 2024-02-06  9:58 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Damien Le Moal, linux-ide, linux-kernel, Greg Kroah-Hartman

On Sun, Feb 04, 2024 at 12:23:29PM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the pata_parport_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/ata/pata_parport/pata_parport.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ata/pata_parport/pata_parport.c b/drivers/ata/pata_parport/pata_parport.c
> index a7adfdcb5e27..9a2cb9ca9d1d 100644
> --- a/drivers/ata/pata_parport/pata_parport.c
> +++ b/drivers/ata/pata_parport/pata_parport.c
> @@ -464,7 +464,7 @@ static void pata_parport_bus_release(struct device *dev)
>  	/* nothing to do here but required to avoid warning on device removal */
>  }
>  
> -static struct bus_type pata_parport_bus_type = {
> +static const struct bus_type pata_parport_bus_type = {
>  	.name = DRV_NAME,
>  };
>  
> 
> ---
> base-commit: c8474c7273ac3bad718c33118aa82efb7b374f6e
> change-id: 20240204-bus_cleanup-ata-bd1625fdab09
> 
> Best regards,
> -- 
> Ricardo B. Marliere <ricardo@marliere.net>
> 

Applied:
https://git.kernel.org/pub/scm/linux/kernel/git/libata/linux.git/log/?h=for-6.9

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

end of thread, other threads:[~2024-02-06  9:58 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:23 [PATCH] ata: pata_parport: make pata_parport_bus_type const Ricardo B. Marliere
2024-02-04 23:32 ` Damien Le Moal
2024-02-05 12:51 ` Greg Kroah-Hartman
2024-02-06  9:58 ` Niklas Cassel

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