* [PATCH 0/2] regmap: add const_struct.checkpatch entries and constify regmap_irq_sub_irq_map
@ 2024-07-06 11:13 Thomas Weißschuh
2024-07-06 11:13 ` [PATCH 1/2] const_structs.checkpatch: add regmap structs Thomas Weißschuh
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2024-07-06 11:13 UTC (permalink / raw)
To: Mark Brown, Greg Kroah-Hartman, Rafael J. Wysocki
Cc: linux-kernel, Thomas Weißschuh
Some non-functional changes to enable more .rodata structs.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Thomas Weißschuh (2):
const_structs.checkpatch: add regmap structs
regmap-irq: handle const struct regmap_irq_sub_irq_map
drivers/base/regmap/regmap-irq.c | 2 +-
include/linux/regmap.h | 2 +-
scripts/const_structs.checkpatch | 10 ++++++++++
3 files changed, 12 insertions(+), 2 deletions(-)
---
base-commit: 1dd28064d4164a4dc9096fd1a7990d2de15f2bb6
change-id: 20240706-regmap-const-structs-25e3d5833d3b
Best regards,
--
Thomas Weißschuh <linux@weissschuh.net>
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 1/2] const_structs.checkpatch: add regmap structs
2024-07-06 11:13 [PATCH 0/2] regmap: add const_struct.checkpatch entries and constify regmap_irq_sub_irq_map Thomas Weißschuh
@ 2024-07-06 11:13 ` Thomas Weißschuh
2024-07-06 11:13 ` [PATCH 2/2] regmap-irq: handle const struct regmap_irq_sub_irq_map Thomas Weißschuh
2024-07-08 14:26 ` [PATCH 0/2] regmap: add const_struct.checkpatch entries and constify regmap_irq_sub_irq_map Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2024-07-06 11:13 UTC (permalink / raw)
To: Mark Brown, Greg Kroah-Hartman, Rafael J. Wysocki
Cc: linux-kernel, Thomas Weißschuh
Many structs used by regmap should be const by default.
Add entries to const_structs.checkpatch for them for checkpatch.pl to
warn on new non-const additions.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
scripts/const_structs.checkpatch | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/scripts/const_structs.checkpatch b/scripts/const_structs.checkpatch
index 52e5bfb61fd0..1bfbb3d7f2e0 100644
--- a/scripts/const_structs.checkpatch
+++ b/scripts/const_structs.checkpatch
@@ -64,7 +64,16 @@ platform_suspend_ops
proc_ops
proto_ops
pwm_ops
+reg_default
+reg_field
+reg_sequence
regmap_access_table
+regmap_bus
+regmap_config
+regmap_irq
+regmap_irq_chip
+regmap_range
+regmap_range_cfg
regulator_ops
reset_control_ops
rpc_pipe_ops
--
2.45.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] regmap-irq: handle const struct regmap_irq_sub_irq_map
2024-07-06 11:13 [PATCH 0/2] regmap: add const_struct.checkpatch entries and constify regmap_irq_sub_irq_map Thomas Weißschuh
2024-07-06 11:13 ` [PATCH 1/2] const_structs.checkpatch: add regmap structs Thomas Weißschuh
@ 2024-07-06 11:13 ` Thomas Weißschuh
2024-07-08 14:26 ` [PATCH 0/2] regmap: add const_struct.checkpatch entries and constify regmap_irq_sub_irq_map Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2024-07-06 11:13 UTC (permalink / raw)
To: Mark Brown, Greg Kroah-Hartman, Rafael J. Wysocki
Cc: linux-kernel, Thomas Weißschuh
The struct instances supplied by the drivers are never modified.
Handle them as const in the regmap core allowing the drivers to put them
into .rodata.
Also add a new entry to const_structs.checkpatch to make sure future
instances of this struct already enter the tree as const.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
drivers/base/regmap/regmap-irq.c | 2 +-
include/linux/regmap.h | 2 +-
scripts/const_structs.checkpatch | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index 45fd13ef13fc..d3ec1345b5b5 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -305,8 +305,8 @@ static inline int read_sub_irq_data(struct regmap_irq_chip_data *data,
unsigned int b)
{
const struct regmap_irq_chip *chip = data->chip;
+ const struct regmap_irq_sub_irq_map *subreg;
struct regmap *map = data->map;
- struct regmap_irq_sub_irq_map *subreg;
unsigned int reg;
int i, ret = 0;
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index a6bc2980a98b..2da1cfc52233 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -1607,7 +1607,7 @@ struct regmap_irq_chip {
unsigned int main_status;
unsigned int num_main_status_bits;
- struct regmap_irq_sub_irq_map *sub_reg_offsets;
+ const struct regmap_irq_sub_irq_map *sub_reg_offsets;
int num_main_regs;
unsigned int status_base;
diff --git a/scripts/const_structs.checkpatch b/scripts/const_structs.checkpatch
index 1bfbb3d7f2e0..cc62980cfa6e 100644
--- a/scripts/const_structs.checkpatch
+++ b/scripts/const_structs.checkpatch
@@ -72,6 +72,7 @@ regmap_bus
regmap_config
regmap_irq
regmap_irq_chip
+regmap_irq_sub_irq_map
regmap_range
regmap_range_cfg
regulator_ops
--
2.45.2
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 0/2] regmap: add const_struct.checkpatch entries and constify regmap_irq_sub_irq_map
2024-07-06 11:13 [PATCH 0/2] regmap: add const_struct.checkpatch entries and constify regmap_irq_sub_irq_map Thomas Weißschuh
2024-07-06 11:13 ` [PATCH 1/2] const_structs.checkpatch: add regmap structs Thomas Weißschuh
2024-07-06 11:13 ` [PATCH 2/2] regmap-irq: handle const struct regmap_irq_sub_irq_map Thomas Weißschuh
@ 2024-07-08 14:26 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2024-07-08 14:26 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rafael J. Wysocki, Thomas Weißschuh; +Cc: linux-kernel
On Sat, 06 Jul 2024 13:13:40 +0200, Thomas Weißschuh wrote:
> Some non-functional changes to enable more .rodata structs.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next
Thanks!
[1/2] const_structs.checkpatch: add regmap structs
commit: 0f02ba48cdaf482d6756515e6936c1e23a316eac
[2/2] regmap-irq: handle const struct regmap_irq_sub_irq_map
commit: f21711bbdbf0d95a389bfaad54ce444b46830d58
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-08 14:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-06 11:13 [PATCH 0/2] regmap: add const_struct.checkpatch entries and constify regmap_irq_sub_irq_map Thomas Weißschuh
2024-07-06 11:13 ` [PATCH 1/2] const_structs.checkpatch: add regmap structs Thomas Weißschuh
2024-07-06 11:13 ` [PATCH 2/2] regmap-irq: handle const struct regmap_irq_sub_irq_map Thomas Weißschuh
2024-07-08 14:26 ` [PATCH 0/2] regmap: add const_struct.checkpatch entries and constify regmap_irq_sub_irq_map Mark Brown
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®