linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] mux: Realign struct mux_chip to save 8 bytes
@ 2025-08-28 16:21 Thorsten Blum
  0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2025-08-28 16:21 UTC (permalink / raw)
  To: Peter Rosin, Thorsten Blum, Kees Cook; +Cc: Krzysztof Kozlowski, linux-kernel

Reduce mux_chip's struct size by 8 bytes by realigning its members.

pahole output before:

  /* size: 752, cachelines: 12, members: 5 */
  /* sum members: 744, holes: 2, sum holes: 8 */
  /* member types with bit paddings: 1, total: 1 bit */
  /* paddings: 1, sum paddings: 3 */
  /* last cacheline: 48 bytes */

and after:

  /* size: 744, cachelines: 12, members: 5 */
  /* member types with bit paddings: 1, total: 1 bit */
  /* paddings: 1, sum paddings: 3 */
  /* last cacheline: 40 bytes */

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 include/linux/mux/driver.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/linux/mux/driver.h b/include/linux/mux/driver.h
index e58e59354e23..8e912399cf3b 100644
--- a/include/linux/mux/driver.h
+++ b/include/linux/mux/driver.h
@@ -56,16 +56,15 @@ struct mux_control {
 /**
  * struct mux_chip -	Represents a chip holding mux controllers.
  * @controllers:	Number of mux controllers handled by the chip.
- * @dev:		Device structure.
  * @id:			Used to identify the device internally.
+ * @dev:		Device structure.
  * @ops:		Mux controller operations.
  * @mux:		Array of mux controllers that are handled.
  */
 struct mux_chip {
 	unsigned int controllers;
-	struct device dev;
 	int id;
-
+	struct device dev;
 	const struct mux_control_ops *ops;
 	struct mux_control mux[] __counted_by(controllers);
 };
-- 
2.50.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-08-28 16:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28 16:21 [PATCH RESEND] mux: Realign struct mux_chip to save 8 bytes Thorsten Blum

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