mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] regmap: sdw-mbq: Reorder regmap_mbq_context struct for better packing
@ 2025-11-07 10:45 Charles Keepax
  2025-11-07 19:19 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Charles Keepax @ 2025-11-07 10:45 UTC (permalink / raw)
  To: broonie; +Cc: linux-kernel, patches

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


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

* Re: [PATCH v2] regmap: sdw-mbq: Reorder regmap_mbq_context struct for better packing
  2025-11-07 10:45 [PATCH v2] regmap: sdw-mbq: Reorder regmap_mbq_context struct for better packing Charles Keepax
@ 2025-11-07 19:19 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-11-07 19:19 UTC (permalink / raw)
  To: Charles Keepax; +Cc: linux-kernel, patches

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


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

end of thread, other threads:[~2025-11-07 19:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-07 10:45 [PATCH v2] regmap: sdw-mbq: Reorder regmap_mbq_context struct for better packing Charles Keepax
2025-11-07 19:19 ` 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®