diff mbox series

hwmon: (nct6683) remove useless function

Message ID 1618293770-55307-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Accepted
Headers show
Series hwmon: (nct6683) remove useless function | expand

Commit Message

Jiapeng Chong April 13, 2021, 6:02 a.m. UTC
Fix the following clang warning:

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

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/hwmon/nct6683.c | 11 -----------
 1 file changed, 11 deletions(-)

Comments

Guenter Roeck April 13, 2021, 4:35 p.m. UTC | #1
On Tue, Apr 13, 2021 at 02:02:50PM +0800, Jiapeng Chong wrote:
> Fix the following clang warning:
> 
> drivers/hwmon/nct6683.c:491:19: warning: unused function 'in_to_reg'
> [-Wunused-function].
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/nct6683.c | 11 -----------
>  1 file changed, 11 deletions(-)
> 
> diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c
> index a23047a..b886cf0 100644
> --- a/drivers/hwmon/nct6683.c
> +++ b/drivers/hwmon/nct6683.c
> @@ -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;
diff mbox series

Patch

diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c
index a23047a..b886cf0 100644
--- a/drivers/hwmon/nct6683.c
+++ b/drivers/hwmon/nct6683.c
@@ -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;