diff mbox series

[v1,2/3] hwmon: (pmbus/mp2975) Constify local pointers to pmbus_driver_info

Message ID 20240325120952.3019767-3-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Headers show
Series hwmon: (pmbus/mp2975) Refactor the driver | expand

Commit Message

Andy Shevchenko March 25, 2024, 12:07 p.m. UTC
Constify the local variables pointing to "struct pmbus_driver_info" and
other encoding params to annotate the function is not modifying pointed
data.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/hwmon/pmbus/mp2975.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Guenter Roeck March 25, 2024, 4:29 p.m. UTC | #1
On Mon, Mar 25, 2024 at 02:07:43PM +0200, Andy Shevchenko wrote:
> Constify the local variables pointing to "struct pmbus_driver_info" and
> other encoding params to annotate the function is not modifying pointed
> data.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied.

Thanks,
Guenter
diff mbox series

Patch

diff --git a/drivers/hwmon/pmbus/mp2975.c b/drivers/hwmon/pmbus/mp2975.c
index af118087c4ee..bc7558dc87ee 100644
--- a/drivers/hwmon/pmbus/mp2975.c
+++ b/drivers/hwmon/pmbus/mp2975.c
@@ -942,7 +942,7 @@  mp2975_vout_per_rail_config_get(struct i2c_client *client,
 	return 0;
 }
 
-static struct pmbus_driver_info mp2975_info = {
+static const struct pmbus_driver_info mp2975_info = {
 	.pages = 1,
 	.format[PSC_VOLTAGE_IN] = linear,
 	.format[PSC_VOLTAGE_OUT] = direct,
@@ -967,7 +967,7 @@  static struct pmbus_driver_info mp2975_info = {
 #endif
 };
 
-static struct pmbus_driver_info mp2973_info = {
+static const struct pmbus_driver_info mp2973_info = {
 	.pages = 1,
 	.format[PSC_VOLTAGE_IN] = linear,
 	.format[PSC_VOLTAGE_OUT] = direct,