All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon: (mr75203) fix undefined reference to `__divdi3'
@ 2022-09-21 12:17 Eliav Farber
  2022-09-21 12:45 ` Sudip Mukherjee
  2022-09-21 14:02 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Eliav Farber @ 2022-09-21 12:17 UTC (permalink / raw)
  To: jdelvare, linux, linux-hwmon, linux-kernel, andriy.shevchenko,
	sudipm.mukherjee
  Cc: farbere, hhhawa, jonnyc, kernel test robot

Fix build error on 32-bit machines.

Fixes: 381a86c545f1 ("hwmon: (mr75203) modify the temperature equation according to series 5 datasheet")
Signed-off-by: Eliav Farber <farbere@amazon.com>
Reported-by: kernel test robot <lkp@intel.com>
---
I will also rework it into the original series (since it's not just a
trivial squash into one previous commit) and you can decide what to use
according to your preference.

 drivers/hwmon/mr75203.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/mr75203.c b/drivers/hwmon/mr75203.c
index 0fea443dc3e1..9c400cf790b5 100644
--- a/drivers/hwmon/mr75203.c
+++ b/drivers/hwmon/mr75203.c
@@ -266,9 +266,9 @@ static long pvt_calc_temp(struct pvt_device *pvt, u32 nbs)
 	struct temp_coeff *ts_coeff = &pvt->ts_coeff;
 
 	s64 tmp = ts_coeff->g +
-		ts_coeff->h * (s64)nbs / ts_coeff->cal5 -
+		div_s64(ts_coeff->h * (s64)nbs, ts_coeff->cal5) -
 		ts_coeff->h / 2 +
-		ts_coeff->j * (s64)pvt->ip_freq / HZ_PER_MHZ;
+		div_s64(ts_coeff->j * (s64)pvt->ip_freq, HZ_PER_MHZ);
 
 	return clamp_val(tmp, PVT_TEMP_MIN_mC, PVT_TEMP_MAX_mC);
 }
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] hwmon: (mr75203) fix undefined reference to `__divdi3'
  2022-09-21 12:17 [PATCH] hwmon: (mr75203) fix undefined reference to `__divdi3' Eliav Farber
@ 2022-09-21 12:45 ` Sudip Mukherjee
  2022-09-21 14:02 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Sudip Mukherjee @ 2022-09-21 12:45 UTC (permalink / raw)
  To: Eliav Farber
  Cc: Jean Delvare, Guenter Roeck, linux-hwmon, linux-kernel,
	andriy.shevchenko, hhhawa, jonnyc, kernel test robot

On Wed, Sep 21, 2022 at 1:17 PM Eliav Farber <farbere@amazon.com> wrote:
>
> Fix build error on 32-bit machines.
>
> Fixes: 381a86c545f1 ("hwmon: (mr75203) modify the temperature equation according to series 5 datasheet")
> Signed-off-by: Eliav Farber <farbere@amazon.com>
> Reported-by: kernel test robot <lkp@intel.com>

Fixed the build of next-20220921 for me.

Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>


-- 
Regards
Sudip

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hwmon: (mr75203) fix undefined reference to `__divdi3'
  2022-09-21 12:17 [PATCH] hwmon: (mr75203) fix undefined reference to `__divdi3' Eliav Farber
  2022-09-21 12:45 ` Sudip Mukherjee
@ 2022-09-21 14:02 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2022-09-21 14:02 UTC (permalink / raw)
  To: Eliav Farber, jdelvare, linux-hwmon, linux-kernel,
	andriy.shevchenko, sudipm.mukherjee
  Cc: hhhawa, jonnyc, kernel test robot

On 9/21/22 05:17, Eliav Farber wrote:
> Fix build error on 32-bit machines.
> 
> Fixes: 381a86c545f1 ("hwmon: (mr75203) modify the temperature equation according to series 5 datasheet")
> Signed-off-by: Eliav Farber <farbere@amazon.com>
> Reported-by: kernel test robot <lkp@intel.com>

Applied.

> ---
> I will also rework it into the original series (since it's not just a
> trivial squash into one previous commit) and you can decide what to use
> according to your preference.
> 

I rather keep this patch separate.

Thanks,
Guenter

>   drivers/hwmon/mr75203.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwmon/mr75203.c b/drivers/hwmon/mr75203.c
> index 0fea443dc3e1..9c400cf790b5 100644
> --- a/drivers/hwmon/mr75203.c
> +++ b/drivers/hwmon/mr75203.c
> @@ -266,9 +266,9 @@ static long pvt_calc_temp(struct pvt_device *pvt, u32 nbs)
>   	struct temp_coeff *ts_coeff = &pvt->ts_coeff;
>   
>   	s64 tmp = ts_coeff->g +
> -		ts_coeff->h * (s64)nbs / ts_coeff->cal5 -
> +		div_s64(ts_coeff->h * (s64)nbs, ts_coeff->cal5) -
>   		ts_coeff->h / 2 +
> -		ts_coeff->j * (s64)pvt->ip_freq / HZ_PER_MHZ;
> +		div_s64(ts_coeff->j * (s64)pvt->ip_freq, HZ_PER_MHZ);
>   
>   	return clamp_val(tmp, PVT_TEMP_MIN_mC, PVT_TEMP_MAX_mC);
>   }


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-21 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-21 12:17 [PATCH] hwmon: (mr75203) fix undefined reference to `__divdi3' Eliav Farber
2022-09-21 12:45 ` Sudip Mukherjee
2022-09-21 14:02 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.