Re: [PATCH v2 0/2] hwmon: (pmbus) Add ST STPDDC60 pmbus driver

From: Guenter Roeck
Date: Thu Feb 11 2021 - 23:50:17 EST


On 2/4/21 5:20 AM, Erik Rosen wrote:
> This patch series adds hardware monitoring support for the ST STPDDC60
> chip. The driver has been tested with a Flex BMR481 converter.
>
> The checkpatch script complains about an unneeded paranthesis in an
> if-statement but gcc gives a warning if it is removed. I side with
> gcc in this case.
>
The if statement doesn't concern me, but I am a bit concerned that
"u8 offset" may overflow. I understand that the return value won't
overflow, but that doesn't necessarily apply to the calculation.
In general, it is safer (and often generates less code) to declare
such variables as int or u32.

Anyway, I don't see a change log against v1 of the series, meaning
I'll have to spend additional time to determine what changed and if
the feedback has been addressed. I'll look at it after the v5.12
commit window closed.

Thanks,
Guenter

> Erik Rosen (2):
> Add pmbus_set_update() function to set update flag on selected sensors
> Add ST STPDDC60 pmbus driver
>
> Documentation/hwmon/index.rst | 1 +
> Documentation/hwmon/stpddc60.rst | 90 +++++++++++
> MAINTAINERS | 7 +
> drivers/hwmon/pmbus/Kconfig | 10 ++
> drivers/hwmon/pmbus/Makefile | 2 +
> drivers/hwmon/pmbus/pmbus.h | 1 +
> drivers/hwmon/pmbus/pmbus_core.c | 11 ++
> drivers/hwmon/pmbus/stpddc60.c | 248 +++++++++++++++++++++++++++++++
> 8 files changed, 370 insertions(+)
> create mode 100644 Documentation/hwmon/stpddc60.rst
> create mode 100644 drivers/hwmon/pmbus/stpddc60.c
>
>
> base-commit: 6ee1d745b7c9fd573fba142a2efdad76a9f1cb04
>