netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] net: constify struct regmap_bus/regmap_config
@ 2024-07-03 21:46 Javier Carrasco
  2024-07-03 21:46 ` [PATCH 1/4] net: dsa: qca8k: constify struct regmap_config Javier Carrasco
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Javier Carrasco @ 2024-07-03 21:46 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, MD Danish Anwar,
	Roger Quadros
  Cc: netdev, linux-kernel, linux-arm-kernel, Javier Carrasco

This series adds the const modifier to the remaining regmap_bus and
regmap_config structs within the net subsystem 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 (4):
      net: dsa: qca8k: constify struct regmap_config
      net: ti: icss-iep: constify struct regmap_config
      net: encx24j600: constify struct regmap_bus/regmap_config
      net: dsa: ar9331: constify struct regmap_bus

 drivers/net/dsa/qca/ar9331.c                       | 2 +-
 drivers/net/dsa/qca/qca8k-8xxx.c                   | 2 +-
 drivers/net/ethernet/microchip/encx24j600-regmap.c | 6 +++---
 drivers/net/ethernet/ti/icssg/icss_iep.c           | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)
---
base-commit: 0b58e108042b0ed28a71cd7edf5175999955b233
change-id: 20240703-net-const-regmap-1c1e64e2c30a

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


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

* [PATCH 1/4] net: dsa: qca8k: constify struct regmap_config
  2024-07-03 21:46 [PATCH 0/4] net: constify struct regmap_bus/regmap_config Javier Carrasco
@ 2024-07-03 21:46 ` Javier Carrasco
  2024-07-04 17:33   ` Vladimir Oltean
  2024-07-03 21:46 ` [PATCH 2/4] net: ti: icss-iep: " Javier Carrasco
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Javier Carrasco @ 2024-07-03 21:46 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, MD Danish Anwar,
	Roger Quadros
  Cc: netdev, linux-kernel, linux-arm-kernel, Javier Carrasco

`qca8k_regmap_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/net/dsa/qca/qca8k-8xxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c
index b3c27cf538e8..f8d8c70642c4 100644
--- a/drivers/net/dsa/qca/qca8k-8xxx.c
+++ b/drivers/net/dsa/qca/qca8k-8xxx.c
@@ -565,7 +565,7 @@ qca8k_regmap_update_bits(void *ctx, uint32_t reg, uint32_t mask, uint32_t write_
 	return qca8k_regmap_update_bits_mii(priv, reg, mask, write_val);
 }
 
-static struct regmap_config qca8k_regmap_config = {
+static const struct regmap_config qca8k_regmap_config = {
 	.reg_bits = 16,
 	.val_bits = 32,
 	.reg_stride = 4,

-- 
2.40.1


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

* [PATCH 2/4] net: ti: icss-iep: constify struct regmap_config
  2024-07-03 21:46 [PATCH 0/4] net: constify struct regmap_bus/regmap_config Javier Carrasco
  2024-07-03 21:46 ` [PATCH 1/4] net: dsa: qca8k: constify struct regmap_config Javier Carrasco
@ 2024-07-03 21:46 ` Javier Carrasco
  2024-07-04 14:42   ` Roger Quadros
  2024-07-05  4:41   ` MD Danish Anwar
  2024-07-03 21:46 ` [PATCH 3/4] net: encx24j600: constify struct regmap_bus/regmap_config Javier Carrasco
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 10+ messages in thread
From: Javier Carrasco @ 2024-07-03 21:46 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, MD Danish Anwar,
	Roger Quadros
  Cc: netdev, linux-kernel, linux-arm-kernel, Javier Carrasco

`am654_icss_iep_regmap_config` is only assigned to a pointer that passes
the data as read-only.

Add the const modifier to the struct and pointer to move the data to a
read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
 drivers/net/ethernet/ti/icssg/icss_iep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/icssg/icss_iep.c b/drivers/net/ethernet/ti/icssg/icss_iep.c
index 003668dee738..75c294ce6fb6 100644
--- a/drivers/net/ethernet/ti/icssg/icss_iep.c
+++ b/drivers/net/ethernet/ti/icssg/icss_iep.c
@@ -95,7 +95,7 @@ enum {
  * @flags: Flags to represent IEP properties
  */
 struct icss_iep_plat_data {
-	struct regmap_config *config;
+	const struct regmap_config *config;
 	u32 reg_offs[ICSS_IEP_MAX_REGS];
 	u32 flags;
 };
@@ -952,7 +952,7 @@ static int icss_iep_regmap_read(void *context, unsigned int reg,
 	return 0;
 }
 
-static struct regmap_config am654_icss_iep_regmap_config = {
+static const struct regmap_config am654_icss_iep_regmap_config = {
 	.name = "icss iep",
 	.reg_stride = 1,
 	.reg_write = icss_iep_regmap_write,

-- 
2.40.1


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

* [PATCH 3/4] net: encx24j600: constify struct regmap_bus/regmap_config
  2024-07-03 21:46 [PATCH 0/4] net: constify struct regmap_bus/regmap_config Javier Carrasco
  2024-07-03 21:46 ` [PATCH 1/4] net: dsa: qca8k: constify struct regmap_config Javier Carrasco
  2024-07-03 21:46 ` [PATCH 2/4] net: ti: icss-iep: " Javier Carrasco
@ 2024-07-03 21:46 ` Javier Carrasco
  2024-07-03 21:46 ` [PATCH 4/4] net: dsa: ar9331: constify struct regmap_bus Javier Carrasco
  2024-07-06  0:10 ` [PATCH 0/4] net: constify struct regmap_bus/regmap_config patchwork-bot+netdevbpf
  4 siblings, 0 replies; 10+ messages in thread
From: Javier Carrasco @ 2024-07-03 21:46 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, MD Danish Anwar,
	Roger Quadros
  Cc: netdev, linux-kernel, linux-arm-kernel, Javier Carrasco

`regmap_encx24j600`, `phycfg` and `phymap_encx24j600` 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/net/ethernet/microchip/encx24j600-regmap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/microchip/encx24j600-regmap.c b/drivers/net/ethernet/microchip/encx24j600-regmap.c
index 3885d6fbace1..26b00e66d912 100644
--- a/drivers/net/ethernet/microchip/encx24j600-regmap.c
+++ b/drivers/net/ethernet/microchip/encx24j600-regmap.c
@@ -474,13 +474,13 @@ static struct regmap_config regcfg = {
 	.unlock = regmap_unlock_mutex,
 };
 
-static struct regmap_bus regmap_encx24j600 = {
+static const struct regmap_bus regmap_encx24j600 = {
 	.write = regmap_encx24j600_write,
 	.read = regmap_encx24j600_read,
 	.reg_update_bits = regmap_encx24j600_reg_update_bits,
 };
 
-static struct regmap_config phycfg = {
+static const struct regmap_config phycfg = {
 	.name = "phy",
 	.reg_bits = 8,
 	.val_bits = 16,
@@ -492,7 +492,7 @@ static struct regmap_config phycfg = {
 	.volatile_reg = encx24j600_phymap_volatile,
 };
 
-static struct regmap_bus phymap_encx24j600 = {
+static const struct regmap_bus phymap_encx24j600 = {
 	.reg_write = regmap_encx24j600_phy_reg_write,
 	.reg_read = regmap_encx24j600_phy_reg_read,
 };

-- 
2.40.1


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

* [PATCH 4/4] net: dsa: ar9331: constify struct regmap_bus
  2024-07-03 21:46 [PATCH 0/4] net: constify struct regmap_bus/regmap_config Javier Carrasco
                   ` (2 preceding siblings ...)
  2024-07-03 21:46 ` [PATCH 3/4] net: encx24j600: constify struct regmap_bus/regmap_config Javier Carrasco
@ 2024-07-03 21:46 ` Javier Carrasco
  2024-07-04 17:30   ` Vladimir Oltean
  2024-07-06  0:10 ` [PATCH 0/4] net: constify struct regmap_bus/regmap_config patchwork-bot+netdevbpf
  4 siblings, 1 reply; 10+ messages in thread
From: Javier Carrasco @ 2024-07-03 21:46 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, MD Danish Anwar,
	Roger Quadros
  Cc: netdev, linux-kernel, linux-arm-kernel, Javier Carrasco

`ar9331_sw_bus` 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/net/dsa/qca/ar9331.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/qca/ar9331.c b/drivers/net/dsa/qca/ar9331.c
index 968cb81088bf..e9f2c67bc15f 100644
--- a/drivers/net/dsa/qca/ar9331.c
+++ b/drivers/net/dsa/qca/ar9331.c
@@ -1021,7 +1021,7 @@ static const struct regmap_config ar9331_mdio_regmap_config = {
 	.cache_type = REGCACHE_MAPLE,
 };
 
-static struct regmap_bus ar9331_sw_bus = {
+static const struct regmap_bus ar9331_sw_bus = {
 	.reg_format_endian_default = REGMAP_ENDIAN_NATIVE,
 	.val_format_endian_default = REGMAP_ENDIAN_NATIVE,
 	.read = ar9331_mdio_read,

-- 
2.40.1


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

* Re: [PATCH 2/4] net: ti: icss-iep: constify struct regmap_config
  2024-07-03 21:46 ` [PATCH 2/4] net: ti: icss-iep: " Javier Carrasco
@ 2024-07-04 14:42   ` Roger Quadros
  2024-07-05  4:41   ` MD Danish Anwar
  1 sibling, 0 replies; 10+ messages in thread
From: Roger Quadros @ 2024-07-04 14:42 UTC (permalink / raw)
  To: Javier Carrasco, Andrew Lunn, Florian Fainelli, Vladimir Oltean,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	MD Danish Anwar
  Cc: netdev, linux-kernel, linux-arm-kernel



On 04/07/2024 00:46, Javier Carrasco wrote:
> `am654_icss_iep_regmap_config` is only assigned to a pointer that passes
> the data as read-only.
> 
> Add the const modifier to the struct and pointer to move the data to a
> read-only section.
> 
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>

Reviewed-by: Roger Quadros <rogerq@kernel.org>

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

* Re: [PATCH 4/4] net: dsa: ar9331: constify struct regmap_bus
  2024-07-03 21:46 ` [PATCH 4/4] net: dsa: ar9331: constify struct regmap_bus Javier Carrasco
@ 2024-07-04 17:30   ` Vladimir Oltean
  0 siblings, 0 replies; 10+ messages in thread
From: Vladimir Oltean @ 2024-07-04 17:30 UTC (permalink / raw)
  To: Javier Carrasco
  Cc: Andrew Lunn, Florian Fainelli, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, MD Danish Anwar, Roger Quadros,
	netdev, linux-kernel, linux-arm-kernel

On Wed, Jul 03, 2024 at 11:46:36PM +0200, Javier Carrasco wrote:
> `ar9331_sw_bus` 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>
> ---

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>

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

* Re: [PATCH 1/4] net: dsa: qca8k: constify struct regmap_config
  2024-07-03 21:46 ` [PATCH 1/4] net: dsa: qca8k: constify struct regmap_config Javier Carrasco
@ 2024-07-04 17:33   ` Vladimir Oltean
  0 siblings, 0 replies; 10+ messages in thread
From: Vladimir Oltean @ 2024-07-04 17:33 UTC (permalink / raw)
  To: Javier Carrasco
  Cc: Andrew Lunn, Florian Fainelli, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, MD Danish Anwar, Roger Quadros,
	netdev, linux-kernel, linux-arm-kernel

On Wed, Jul 03, 2024 at 11:46:33PM +0200, Javier Carrasco wrote:
> `qca8k_regmap_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>
> ---

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>

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

* Re: [PATCH 2/4] net: ti: icss-iep: constify struct regmap_config
  2024-07-03 21:46 ` [PATCH 2/4] net: ti: icss-iep: " Javier Carrasco
  2024-07-04 14:42   ` Roger Quadros
@ 2024-07-05  4:41   ` MD Danish Anwar
  1 sibling, 0 replies; 10+ messages in thread
From: MD Danish Anwar @ 2024-07-05  4:41 UTC (permalink / raw)
  To: Javier Carrasco, Andrew Lunn, Florian Fainelli, Vladimir Oltean,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Roger Quadros
  Cc: netdev, linux-kernel, linux-arm-kernel



On 04/07/24 3:16 am, Javier Carrasco wrote:
> `am654_icss_iep_regmap_config` is only assigned to a pointer that passes
> the data as read-only.
> 
> Add the const modifier to the struct and pointer to move the data to a
> read-only section.
> 
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>

Reviewed-by: MD Danish Anwar <danishanwar@ti.com>

-- 
Thanks and Regards,
Danish

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

* Re: [PATCH 0/4] net: constify struct regmap_bus/regmap_config
  2024-07-03 21:46 [PATCH 0/4] net: constify struct regmap_bus/regmap_config Javier Carrasco
                   ` (3 preceding siblings ...)
  2024-07-03 21:46 ` [PATCH 4/4] net: dsa: ar9331: constify struct regmap_bus Javier Carrasco
@ 2024-07-06  0:10 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-07-06  0:10 UTC (permalink / raw)
  To: Javier Carrasco
  Cc: andrew, f.fainelli, olteanv, davem, edumazet, kuba, pabeni,
	danishanwar, rogerq, netdev, linux-kernel, linux-arm-kernel

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 03 Jul 2024 23:46:32 +0200 you wrote:
> This series adds the const modifier to the remaining regmap_bus and
> regmap_config structs within the net subsystem 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>
> 
> [...]

Here is the summary with links:
  - [1/4] net: dsa: qca8k: constify struct regmap_config
    https://git.kernel.org/netdev/net-next/c/8dfbb068a4e1
  - [2/4] net: ti: icss-iep: constify struct regmap_config
    https://git.kernel.org/netdev/net-next/c/7f805f6396d4
  - [3/4] net: encx24j600: constify struct regmap_bus/regmap_config
    https://git.kernel.org/netdev/net-next/c/9969163c4472
  - [4/4] net: dsa: ar9331: constify struct regmap_bus
    https://git.kernel.org/netdev/net-next/c/3b05c7995cae

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

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

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-03 21:46 [PATCH 0/4] net: constify struct regmap_bus/regmap_config Javier Carrasco
2024-07-03 21:46 ` [PATCH 1/4] net: dsa: qca8k: constify struct regmap_config Javier Carrasco
2024-07-04 17:33   ` Vladimir Oltean
2024-07-03 21:46 ` [PATCH 2/4] net: ti: icss-iep: " Javier Carrasco
2024-07-04 14:42   ` Roger Quadros
2024-07-05  4:41   ` MD Danish Anwar
2024-07-03 21:46 ` [PATCH 3/4] net: encx24j600: constify struct regmap_bus/regmap_config Javier Carrasco
2024-07-03 21:46 ` [PATCH 4/4] net: dsa: ar9331: constify struct regmap_bus Javier Carrasco
2024-07-04 17:30   ` Vladimir Oltean
2024-07-06  0:10 ` [PATCH 0/4] net: constify struct regmap_bus/regmap_config patchwork-bot+netdevbpf

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).