mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] media: Constify struct regmap_config
@ 2024-07-05 10:53 Javier Carrasco
  2024-07-05 10:53 ` [PATCH 1/2] media: i2c: tvp5150: " Javier Carrasco
  2024-07-05 10:53 ` [PATCH 2/2] media: platform: allegro-dvt: " Javier Carrasco
  0 siblings, 2 replies; 5+ messages in thread
From: Javier Carrasco @ 2024-07-05 10:53 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Michael Tretter, Pengutronix Kernel Team
  Cc: linux-media, linux-kernel, Javier Carrasco

This series adds the const modifier to the remaining regmap_config
structs under media/ that are effectively used as const (i.e., only
read after their declaration), but kept as writtable data.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
Javier Carrasco (2):
      media: i2c: tvp5150: Constify struct regmap_config
      media: platform: allegro-dvt: Constify struct regmap_config

 drivers/media/i2c/tvp5150.c                       | 2 +-
 drivers/media/platform/allegro-dvt/allegro-core.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
base-commit: 0b58e108042b0ed28a71cd7edf5175999955b233
change-id: 20240705-media-const-regmap_config-958dfd37063c

Best regards,
-- 
Javier Carrasco <javier.carrasco.cruz@gmail.com>


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

* [PATCH 1/2] media: i2c: tvp5150: Constify struct regmap_config
  2024-07-05 10:53 [PATCH 0/2] media: Constify struct regmap_config Javier Carrasco
@ 2024-07-05 10:53 ` Javier Carrasco
  2024-08-07 10:00   ` Hans Verkuil
  2024-07-05 10:53 ` [PATCH 2/2] media: platform: allegro-dvt: " Javier Carrasco
  1 sibling, 1 reply; 5+ messages in thread
From: Javier Carrasco @ 2024-07-05 10:53 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Michael Tretter, Pengutronix Kernel Team
  Cc: linux-media, linux-kernel, Javier Carrasco

`tvp5150_config` is not modified and can be declared as const to
move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
 drivers/media/i2c/tvp5150.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index 64b91aa3c82a..3205ecd60281 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -1812,7 +1812,7 @@ static const struct regmap_access_table tvp5150_readable_table = {
 	.n_yes_ranges = ARRAY_SIZE(tvp5150_readable_ranges),
 };
 
-static struct regmap_config tvp5150_config = {
+static const struct regmap_config tvp5150_config = {
 	.reg_bits = 8,
 	.val_bits = 8,
 	.max_register = 0xff,

-- 
2.40.1


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

* [PATCH 2/2] media: platform: allegro-dvt: Constify struct regmap_config
  2024-07-05 10:53 [PATCH 0/2] media: Constify struct regmap_config Javier Carrasco
  2024-07-05 10:53 ` [PATCH 1/2] media: i2c: tvp5150: " Javier Carrasco
@ 2024-07-05 10:53 ` Javier Carrasco
  2024-07-22  7:48   ` Michael Tretter
  1 sibling, 1 reply; 5+ messages in thread
From: Javier Carrasco @ 2024-07-05 10:53 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Michael Tretter, Pengutronix Kernel Team
  Cc: linux-media, linux-kernel, Javier Carrasco

`allegro_regmap_config` and `allegro_sram_config` are not modified and
can be declared as const to move their data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
 drivers/media/platform/allegro-dvt/allegro-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/allegro-dvt/allegro-core.c b/drivers/media/platform/allegro-dvt/allegro-core.c
index da61f9beb6b4..1a19fef62e81 100644
--- a/drivers/media/platform/allegro-dvt/allegro-core.c
+++ b/drivers/media/platform/allegro-dvt/allegro-core.c
@@ -179,7 +179,7 @@ struct allegro_dev {
 	struct list_head channels;
 };
 
-static struct regmap_config allegro_regmap_config = {
+static const struct regmap_config allegro_regmap_config = {
 	.name = "regmap",
 	.reg_bits = 32,
 	.val_bits = 32,
@@ -188,7 +188,7 @@ static struct regmap_config allegro_regmap_config = {
 	.cache_type = REGCACHE_NONE,
 };
 
-static struct regmap_config allegro_sram_config = {
+static const struct regmap_config allegro_sram_config = {
 	.name = "sram",
 	.reg_bits = 32,
 	.val_bits = 32,

-- 
2.40.1


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

* Re: [PATCH 2/2] media: platform: allegro-dvt: Constify struct regmap_config
  2024-07-05 10:53 ` [PATCH 2/2] media: platform: allegro-dvt: " Javier Carrasco
@ 2024-07-22  7:48   ` Michael Tretter
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Tretter @ 2024-07-22  7:48 UTC (permalink / raw)
  To: Javier Carrasco
  Cc: Mauro Carvalho Chehab, Pengutronix Kernel Team, linux-media,
	linux-kernel

On Fri, 05 Jul 2024 12:53:51 +0200, Javier Carrasco wrote:
> `allegro_regmap_config` and `allegro_sram_config` are not modified and
> can be declared as const to move their data to a read-only section.

Christophe sent a similar patch [0] before, which already has my
Reviewed-by.

Michael

[0[ https://lore.kernel.org/linux-media/01b9b16b2f86f4d16d9871a29dcda9245512a1f7.1714894086.git.christophe.jaillet@wanadoo.fr/

> 
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> ---
>  drivers/media/platform/allegro-dvt/allegro-core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/allegro-dvt/allegro-core.c b/drivers/media/platform/allegro-dvt/allegro-core.c
> index da61f9beb6b4..1a19fef62e81 100644
> --- a/drivers/media/platform/allegro-dvt/allegro-core.c
> +++ b/drivers/media/platform/allegro-dvt/allegro-core.c
> @@ -179,7 +179,7 @@ struct allegro_dev {
>  	struct list_head channels;
>  };
>  
> -static struct regmap_config allegro_regmap_config = {
> +static const struct regmap_config allegro_regmap_config = {
>  	.name = "regmap",
>  	.reg_bits = 32,
>  	.val_bits = 32,
> @@ -188,7 +188,7 @@ static struct regmap_config allegro_regmap_config = {
>  	.cache_type = REGCACHE_NONE,
>  };
>  
> -static struct regmap_config allegro_sram_config = {
> +static const struct regmap_config allegro_sram_config = {
>  	.name = "sram",
>  	.reg_bits = 32,
>  	.val_bits = 32,
> 
> -- 
> 2.40.1
> 
> 

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

* Re: [PATCH 1/2] media: i2c: tvp5150: Constify struct regmap_config
  2024-07-05 10:53 ` [PATCH 1/2] media: i2c: tvp5150: " Javier Carrasco
@ 2024-08-07 10:00   ` Hans Verkuil
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Verkuil @ 2024-08-07 10:00 UTC (permalink / raw)
  To: Javier Carrasco, Mauro Carvalho Chehab, Michael Tretter,
	Pengutronix Kernel Team
  Cc: linux-media, linux-kernel

On 05/07/2024 12:53, Javier Carrasco wrote:
> `tvp5150_config` is not modified and can be declared as const to
> move its data to a read-only section.

This is a duplicate of:

https://patchwork.linuxtv.org/project/linux-media/patch/119b3ec62e6305c83ffadc7f40cbda9fc3d5be11.1714893773.git.christophe.jaillet@wanadoo.fr/

I'll take that one since that also constifies i2c_vbi_ram_value.

Regards,

	Hans

> 
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> ---
>  drivers/media/i2c/tvp5150.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
> index 64b91aa3c82a..3205ecd60281 100644
> --- a/drivers/media/i2c/tvp5150.c
> +++ b/drivers/media/i2c/tvp5150.c
> @@ -1812,7 +1812,7 @@ static const struct regmap_access_table tvp5150_readable_table = {
>  	.n_yes_ranges = ARRAY_SIZE(tvp5150_readable_ranges),
>  };
>  
> -static struct regmap_config tvp5150_config = {
> +static const struct regmap_config tvp5150_config = {
>  	.reg_bits = 8,
>  	.val_bits = 8,
>  	.max_register = 0xff,
> 


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

end of thread, other threads:[~2024-08-07 10:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-05 10:53 [PATCH 0/2] media: Constify struct regmap_config Javier Carrasco
2024-07-05 10:53 ` [PATCH 1/2] media: i2c: tvp5150: " Javier Carrasco
2024-08-07 10:00   ` Hans Verkuil
2024-07-05 10:53 ` [PATCH 2/2] media: platform: allegro-dvt: " Javier Carrasco
2024-07-22  7:48   ` Michael Tretter

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

all inboxes | Powered by JetHome®