drivers/base/regmap/regmap-sdw-mbq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Avoid a hole in struct regmap_mbq_context by shuffling the members
slightly. Pahole before:
struct regmap_mbq_context {
struct device * dev; /* 0 8 */
struct sdw_slave * sdw; /* 8 8 */
struct regmap_sdw_mbq_cfg cfg; /* 16 32 */
int val_size; /* 48 4 */
/* XXX 4 bytes hole, try to pack */
bool (*readable_reg)(struct device *, unsigned int); /* 56 8 */
/* size: 64, cachelines: 1, members: 5 */
/* sum members: 60, holes: 1, sum holes: 4 */
};
Pahole after:
struct regmap_mbq_context {
struct device * dev; /* 0 8 */
struct sdw_slave * sdw; /* 8 8 */
bool (*readable_reg)(struct device *, unsigned int); /* 16 8 */
struct regmap_sdw_mbq_cfg cfg; /* 24 32 */
int val_size; /* 56 4 */
/* size: 64, cachelines: 1, members: 5 */
/* padding: 4 */
};
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
Changes since v1:
- Update commit description to include pahole outputs before and after
drivers/base/regmap/regmap-sdw-mbq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/base/regmap/regmap-sdw-mbq.c b/drivers/base/regmap/regmap-sdw-mbq.c
index 86644bbd07100..225c158d7f9d7 100644
--- a/drivers/base/regmap/regmap-sdw-mbq.c
+++ b/drivers/base/regmap/regmap-sdw-mbq.c
@@ -16,10 +16,11 @@
struct regmap_mbq_context {
struct device *dev;
+ bool (*readable_reg)(struct device *dev, unsigned int reg);
+
struct regmap_sdw_mbq_cfg cfg;
int val_size;
- bool (*readable_reg)(struct device *dev, unsigned int reg);
};
static int regmap_sdw_mbq_size(struct regmap_mbq_context *ctx, unsigned int reg)
--
2.47.3
On Fri, 07 Nov 2025 10:45:51 +0000, Charles Keepax wrote:
> Avoid a hole in struct regmap_mbq_context by shuffling the members
> slightly. Pahole before:
>
> struct regmap_mbq_context {
> struct device * dev; /* 0 8 */
> struct sdw_slave * sdw; /* 8 8 */
> struct regmap_sdw_mbq_cfg cfg; /* 16 32 */
> int val_size; /* 48 4 */
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next
Thanks!
[1/1] regmap: sdw-mbq: Reorder regmap_mbq_context struct for better packing
commit: 6985defd1d832f1dd9d1977a6a2cc2cef7632704
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
© 2016 - 2025 Red Hat, Inc.