Thread (9 messages) flat view 9 messages, 2 authors, 2025-08-18
STALE390d

[PATCH v4 3/3] iio: adc: ltc2497: reorder struct members to fix memory holes

From: Yusuf Alper Bilgin <hidden>
Date: 2025-08-15 10:02:10
Also in: linux-iio, lkml
Subsystem: analog devices inc iio drivers, iio subsystem and drivers, the rest · Maintainers: Nuno Sá, Michael Hennerich, Jonathan Cameron, Linus Torvalds

Reorder members in the `ltc2497_chip_info` and `ltc2497core_driverdata`
structs to eliminate memory holes identified by the `pahole` tool.

Confirm via the `bloat-o-meter` that this change has no significant
impact on the final code size:

| Object File     | Total Size Change |
|-----------------|-------------------|
| ltc2497-core.o  | 0 (0.00%)         |
| ltc2497.o       | +2 (+0.10%)       |
| ltc2496.o       | 0 (0.00%)         |

Signed-off-by: Yusuf Alper Bilgin <redacted>
---
 drivers/iio/adc/ltc2497.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/ltc2497.h b/drivers/iio/adc/ltc2497.h
index dfe2d5c30017adeb3f17e57fc5bf1e0e792ff30f..48e9f74870ab489b5df6e69a39446610c6a72b93 100644
--- a/drivers/iio/adc/ltc2497.h
+++ b/drivers/iio/adc/ltc2497.h
@@ -5,8 +5,8 @@
 #define LTC2497_CONVERSION_TIME_MS	150ULL
 
 struct ltc2497_chip_info {
-	u32 resolution;
 	const char *name;
+	u32 resolution;
 	/*
 	 * Represents the datasheet constant from the temperature formula:
 	 * T_Kelvin = (DATAOUT * Vref) / temp_scale, where Vref is in Volts.
@@ -20,15 +20,15 @@ struct ltc2497_chip_info {
 };
 
 struct ltc2497core_driverdata {
-	struct regulator *ref;
-	ktime_t	time_prev;
 	/* lock to protect against multiple access to the device */
 	struct mutex lock;
+	struct regulator *ref;
+	ktime_t	time_prev;
 	const struct ltc2497_chip_info	*chip_info;
-	u8 addr_prev;
 	int (*result_and_measure)(struct ltc2497core_driverdata *ddata,
 				  u8 address, int *val);
 	enum iio_chan_type chan_type_prev;
+	u8 addr_prev;
 };
 
 int ltc2497core_probe(struct device *dev, struct iio_dev *indio_dev);
-- 
2.43.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help