[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250814-ltc2495-v3-4-c2a6cecd6b99@gmail.com>
Date: Thu, 14 Aug 2025 13:00:20 +0200
From: Yusuf Alper Bilgin <y.alperbilgin@...il.com>
To: Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Jonathan Cameron <jic23@...nel.org>, David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Liam Beguin <liambeguin@...il.com>
Cc: Michael Hennerich <michael.hennerich@...log.com>,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, Yusuf Alper Bilgin <y.alperbilgin@...il.com>
Subject: [PATCH v3 4/4] iio: adc: ltc2497: reorder struct members to fix
memory holes
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 <y.alperbilgin@...il.com>
---
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 65f406bc61c24b912de4beed604a074b3ea9df91..578f55efc5c400980fe8bbd2b220aafb222d6f33 100644
--- a/drivers/iio/adc/ltc2497.h
+++ b/drivers/iio/adc/ltc2497.h
@@ -10,8 +10,8 @@
#define LTC2497_ENABLE_TEMPERATURE_CONV (LTC2497_EN2 | LTC2497_IM)
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.
@@ -27,12 +27,12 @@ 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;
const struct ltc2497_chip_info *chip_info;
- u8 addr_prev;
int (*result_and_measure)(struct ltc2497core_driverdata *ddata,
u8 address, int *val);
+ /* lock to protect against multiple access to the device */
+ struct mutex lock;
+ u8 addr_prev;
};
int ltc2497core_probe(struct device *dev, struct iio_dev *indio_dev);
--
2.43.0
Powered by blists - more mailing lists