All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] drivers: media: struct bus_type cleanup
@ 2024-02-03 15:31 Ricardo B. Marliere
  2024-02-03 15:31 ` [PATCH 1/2] media: cec: make cec_bus_type const Ricardo B. Marliere
  2024-02-03 15:31 ` [PATCH 2/2] media: media-devnode: make media_bus_type const Ricardo B. Marliere
  0 siblings, 2 replies; 8+ messages in thread
From: Ricardo B. Marliere @ 2024-02-03 15:31 UTC (permalink / raw)
  To: Hans Verkuil, Mauro Carvalho Chehab, Sakari Ailus, Laurent Pinchart
  Cc: Greg Kroah-Hartman, linux-media, linux-kernel, 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

Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>

---
Ricardo B. Marliere (2):
      media: cec: make cec_bus_type const
      media: media-devnode: make media_bus_type const

 drivers/media/cec/core/cec-core.c | 2 +-
 drivers/media/mc/mc-devnode.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
base-commit: 41bccc98fb7931d63d03f326a746ac4d429c1dd3
change-id: 20240203-bus_cleanup-media-0ee6e332fef5

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


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

* [PATCH 1/2] media: cec: make cec_bus_type const
  2024-02-03 15:31 [PATCH 0/2] drivers: media: struct bus_type cleanup Ricardo B. Marliere
@ 2024-02-03 15:31 ` Ricardo B. Marliere
  2024-02-03 15:58   ` Greg Kroah-Hartman
  2024-02-04  8:47   ` Laurent Pinchart
  2024-02-03 15:31 ` [PATCH 2/2] media: media-devnode: make media_bus_type const Ricardo B. Marliere
  1 sibling, 2 replies; 8+ messages in thread
From: Ricardo B. Marliere @ 2024-02-03 15:31 UTC (permalink / raw)
  To: Hans Verkuil, Mauro Carvalho Chehab, Sakari Ailus, Laurent Pinchart
  Cc: Greg Kroah-Hartman, linux-media, linux-kernel, Ricardo B. Marliere

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

diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c
index 7e153c5cad04..5a54db839e5d 100644
--- a/drivers/media/cec/core/cec-core.c
+++ b/drivers/media/cec/core/cec-core.c
@@ -93,7 +93,7 @@ static void cec_devnode_release(struct device *cd)
 	cec_delete_adapter(to_cec_adapter(devnode));
 }
 
-static struct bus_type cec_bus_type = {
+static const struct bus_type cec_bus_type = {
 	.name = CEC_NAME,
 };
 

-- 
2.43.0


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

* [PATCH 2/2] media: media-devnode: make media_bus_type const
  2024-02-03 15:31 [PATCH 0/2] drivers: media: struct bus_type cleanup Ricardo B. Marliere
  2024-02-03 15:31 ` [PATCH 1/2] media: cec: make cec_bus_type const Ricardo B. Marliere
@ 2024-02-03 15:31 ` Ricardo B. Marliere
  2024-02-03 15:58   ` Greg Kroah-Hartman
  2024-02-04  8:47   ` Laurent Pinchart
  1 sibling, 2 replies; 8+ messages in thread
From: Ricardo B. Marliere @ 2024-02-03 15:31 UTC (permalink / raw)
  To: Hans Verkuil, Mauro Carvalho Chehab, Sakari Ailus, Laurent Pinchart
  Cc: Greg Kroah-Hartman, linux-media, linux-kernel, Ricardo B. Marliere

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

diff --git a/drivers/media/mc/mc-devnode.c b/drivers/media/mc/mc-devnode.c
index 680fbb3a9340..90646805bd81 100644
--- a/drivers/media/mc/mc-devnode.c
+++ b/drivers/media/mc/mc-devnode.c
@@ -63,7 +63,7 @@ static void media_devnode_release(struct device *cd)
 	pr_debug("%s: Media Devnode Deallocated\n", __func__);
 }
 
-static struct bus_type media_bus_type = {
+static const struct bus_type media_bus_type = {
 	.name = MEDIA_NAME,
 };
 

-- 
2.43.0


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

* Re: [PATCH 1/2] media: cec: make cec_bus_type const
  2024-02-03 15:31 ` [PATCH 1/2] media: cec: make cec_bus_type const Ricardo B. Marliere
@ 2024-02-03 15:58   ` Greg Kroah-Hartman
  2024-02-04  8:47   ` Laurent Pinchart
  1 sibling, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-03 15:58 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Hans Verkuil, Mauro Carvalho Chehab, Sakari Ailus,
	Laurent Pinchart, linux-media, linux-kernel

On Sat, Feb 03, 2024 at 12:31:26PM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the cec_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/media/cec/core/cec-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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

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

* Re: [PATCH 2/2] media: media-devnode: make media_bus_type const
  2024-02-03 15:31 ` [PATCH 2/2] media: media-devnode: make media_bus_type const Ricardo B. Marliere
@ 2024-02-03 15:58   ` Greg Kroah-Hartman
  2024-02-04  8:47   ` Laurent Pinchart
  1 sibling, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-03 15:58 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Hans Verkuil, Mauro Carvalho Chehab, Sakari Ailus,
	Laurent Pinchart, linux-media, linux-kernel

On Sat, Feb 03, 2024 at 12:31:27PM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the media_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/media/mc/mc-devnode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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

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

* Re: [PATCH 2/2] media: media-devnode: make media_bus_type const
  2024-02-03 15:31 ` [PATCH 2/2] media: media-devnode: make media_bus_type const Ricardo B. Marliere
  2024-02-03 15:58   ` Greg Kroah-Hartman
@ 2024-02-04  8:47   ` Laurent Pinchart
  1 sibling, 0 replies; 8+ messages in thread
From: Laurent Pinchart @ 2024-02-04  8:47 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Hans Verkuil, Mauro Carvalho Chehab, Sakari Ailus,
	Greg Kroah-Hartman, linux-media, linux-kernel

Hi Ricardo,

Thank you for the patch.

On Sat, Feb 03, 2024 at 12:31:27PM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the media_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: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/media/mc/mc-devnode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/mc/mc-devnode.c b/drivers/media/mc/mc-devnode.c
> index 680fbb3a9340..90646805bd81 100644
> --- a/drivers/media/mc/mc-devnode.c
> +++ b/drivers/media/mc/mc-devnode.c
> @@ -63,7 +63,7 @@ static void media_devnode_release(struct device *cd)
>  	pr_debug("%s: Media Devnode Deallocated\n", __func__);
>  }
>  
> -static struct bus_type media_bus_type = {
> +static const struct bus_type media_bus_type = {
>  	.name = MEDIA_NAME,
>  };
>  
> 

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/2] media: cec: make cec_bus_type const
  2024-02-03 15:31 ` [PATCH 1/2] media: cec: make cec_bus_type const Ricardo B. Marliere
  2024-02-03 15:58   ` Greg Kroah-Hartman
@ 2024-02-04  8:47   ` Laurent Pinchart
  2024-02-04  9:39     ` Hans Verkuil
  1 sibling, 1 reply; 8+ messages in thread
From: Laurent Pinchart @ 2024-02-04  8:47 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Hans Verkuil, Mauro Carvalho Chehab, Sakari Ailus,
	Greg Kroah-Hartman, linux-media, linux-kernel

Hi Ricardo,

Thank you for the patch.

On Sat, Feb 03, 2024 at 12:31:26PM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the cec_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: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

Hans, I assume you'll pick this patch. Could you also pick 2/2 from the
series ?

> ---
>  drivers/media/cec/core/cec-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c
> index 7e153c5cad04..5a54db839e5d 100644
> --- a/drivers/media/cec/core/cec-core.c
> +++ b/drivers/media/cec/core/cec-core.c
> @@ -93,7 +93,7 @@ static void cec_devnode_release(struct device *cd)
>  	cec_delete_adapter(to_cec_adapter(devnode));
>  }
>  
> -static struct bus_type cec_bus_type = {
> +static const struct bus_type cec_bus_type = {
>  	.name = CEC_NAME,
>  };
>  

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/2] media: cec: make cec_bus_type const
  2024-02-04  8:47   ` Laurent Pinchart
@ 2024-02-04  9:39     ` Hans Verkuil
  0 siblings, 0 replies; 8+ messages in thread
From: Hans Verkuil @ 2024-02-04  9:39 UTC (permalink / raw)
  To: Laurent Pinchart, Ricardo B. Marliere
  Cc: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman,
	linux-media, linux-kernel

On 04/02/2024 09:47, Laurent Pinchart wrote:
> Hi Ricardo,
> 
> Thank you for the patch.
> 
> On Sat, Feb 03, 2024 at 12:31:26PM -0300, Ricardo B. Marliere wrote:
>> Now that the driver core can properly handle constant struct bus_type,
>> move the cec_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: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> 
> Hans, I assume you'll pick this patch. Could you also pick 2/2 from the
> series ?

Of course!

	Hans

> 
>> ---
>>  drivers/media/cec/core/cec-core.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c
>> index 7e153c5cad04..5a54db839e5d 100644
>> --- a/drivers/media/cec/core/cec-core.c
>> +++ b/drivers/media/cec/core/cec-core.c
>> @@ -93,7 +93,7 @@ static void cec_devnode_release(struct device *cd)
>>  	cec_delete_adapter(to_cec_adapter(devnode));
>>  }
>>  
>> -static struct bus_type cec_bus_type = {
>> +static const struct bus_type cec_bus_type = {
>>  	.name = CEC_NAME,
>>  };
>>  
> 


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

end of thread, other threads:[~2024-02-04  9:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-03 15:31 [PATCH 0/2] drivers: media: struct bus_type cleanup Ricardo B. Marliere
2024-02-03 15:31 ` [PATCH 1/2] media: cec: make cec_bus_type const Ricardo B. Marliere
2024-02-03 15:58   ` Greg Kroah-Hartman
2024-02-04  8:47   ` Laurent Pinchart
2024-02-04  9:39     ` Hans Verkuil
2024-02-03 15:31 ` [PATCH 2/2] media: media-devnode: make media_bus_type const Ricardo B. Marliere
2024-02-03 15:58   ` Greg Kroah-Hartman
2024-02-04  8:47   ` Laurent Pinchart

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.