Skip to contentSkip to conversation

hwmon: (nct6683) remove useless function

PATCH Applied Jiapeng Chong 2 participants 2 messages Apr 13, 2021 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (nct6683) remove useless function

Fix the following clang warning:

drivers/hwmon/nct6683.c:491:19: warning: unused function 'in_to_reg' [-Wunused-function].

---
 drivers/hwmon/nct6683.c | 11 -----------
 1 file changed, 11 deletions(-)
drivers/hwmon/nct6683.c +0 -11
index a23047a..b886cf0 100644
@@ -488,17 +488,6 @@ static inline long in_from_reg(u16 reg, u8 src)
 	return reg * scale;
 }
 
-static inline u16 in_to_reg(u32 val, u8 src)
-{
-	int scale = 16;
-
-	if (src == MON_SRC_VCC || src == MON_SRC_VSB || src == MON_SRC_AVSB ||
-	    src == MON_SRC_VBAT)
-		scale <<= 1;
-
-	return clamp_val(DIV_ROUND_CLOSEST(val, scale), 0, 127);
-}
-
 static u16 nct6683_read(struct nct6683_data *data, u16 reg)
 {
 	int res;
Signature · 1 line
1.8.3.1
maintainer Applied
#1 lore raw
Quoted 7 lines · Jiapeng Chong

Fix the following clang warning:

drivers/hwmon/nct6683.c:491:19: warning: unused function 'in_to_reg' [-Wunused-function].

Applied.

Thanks,
Guenter

Quoted 26 lines
---
 drivers/hwmon/nct6683.c | 11 -----------
 1 file changed, 11 deletions(-)
drivers/hwmon/nct6683.c +0 -11
index a23047a..b886cf0 100644
@@ -488,17 +488,6 @@ static inline long in_from_reg(u16 reg, u8 src)
 	return reg * scale;
 }
 
-static inline u16 in_to_reg(u32 val, u8 src)
-{
-	int scale = 16;
-
-	if (src == MON_SRC_VCC || src == MON_SRC_VSB || src == MON_SRC_AVSB ||
-	    src == MON_SRC_VBAT)
-		scale <<= 1;
-
-	return clamp_val(DIV_ROUND_CLOSEST(val, scale), 0, 127);
-}
-
 static u16 nct6683_read(struct nct6683_data *data, u16 reg)
 {
 	int res;