Skip to content

Commit c4cdf73

Browse files
tobluxkuba-moo
authored andcommitted
net: phy: marvell-88q2xxx: Fix clamped value in mv88q2xxx_hwmon_write
The local variable 'val' was never clamped to -75000 or 180000 because the return value of clamp_val() was not used. Fix this by assigning the clamped value back to 'val', and use clamp() instead of clamp_val(). Cc: [email protected] Fixes: a557a92 ("net: phy: marvell-88q2xxx: add support for temperature sensor") Signed-off-by: Thorsten Blum <[email protected]> Reviewed-by: Dimitri Fedrau <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 6a107cf commit c4cdf73

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/phy/marvell-88q2xxx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ static int mv88q2xxx_hwmon_write(struct device *dev,
698698

699699
switch (attr) {
700700
case hwmon_temp_max:
701-
clamp_val(val, -75000, 180000);
701+
val = clamp(val, -75000, 180000);
702702
val = (val / 1000) + 75;
703703
val = FIELD_PREP(MDIO_MMD_PCS_MV_TEMP_SENSOR3_INT_THRESH_MASK,
704704
val);

0 commit comments

Comments
 (0)