linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Jonathan Cormier <jcormier@criticallink.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Bob Duke <bduke@criticallink.com>,
	John Pruitt <jpruitt@criticallink.com>
Subject: Re: [PATCH v4 5/5] hwmon: ltc2945: Convert division to DIV_ROUND_CLOSEST_ULL
Date: Sun, 29 Jan 2023 11:55:28 -0800	[thread overview]
Message-ID: <20230129195528.GA1418977@roeck-us.net> (raw)
In-Reply-To: <20230126-b4-ltc2945_shunt_resistor-v4-5-bb913470d8da@criticallink.com>

On Thu, Jan 26, 2023 at 05:32:27PM -0500, Jonathan Cormier wrote:
> Convert division to DIV_ROUND_CLOSEST_ULL to match code
> in same function.
> 
> Signed-off-by: Jonathan Cormier <jcormier@criticallink.comi
> ---
>  drivers/hwmon/ltc2945.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/ltc2945.c b/drivers/hwmon/ltc2945.c
> index 0b5e448b4f12..33341d01f1f7 100644
> --- a/drivers/hwmon/ltc2945.c
> +++ b/drivers/hwmon/ltc2945.c
> @@ -212,7 +212,7 @@ static long long ltc2945_val_to_reg(struct device *dev, u8 reg,
>  	case LTC2945_MAX_VIN_THRES_H:
>  	case LTC2945_MIN_VIN_THRES_H:
>  		/* 25 mV resolution. */
> -		val /= 25;
> +		val = DIV_ROUND_CLOSEST_ULL(val, 25);

This needs to be combined with the previous patch since that patch changes
'val' from unsigned long to unsigned long long, causing a compile failure
on 32-bit builds.

I'll do that unless some other 32 bit build failure shows up.

Guenter

>  		break;
>  	case LTC2945_ADIN_H:
>  	case LTC2945_MAX_ADIN_H:
> 
> -- 
> 2.25.1
> 

      reply	other threads:[~2023-01-29 19:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26 22:32 [PATCH v4 0/5] hwmon: ltc2945: Add binding and shunt resistor support Jonathan Cormier
2023-01-26 22:32 ` [PATCH v4 1/5] dt-bindings: hwmon: adi,ltc2945: Add binding Jonathan Cormier
2023-01-29 20:16   ` Guenter Roeck
2023-01-30 15:19     ` Jon Cormier
2023-01-30 15:25       ` Jon Cormier
2023-01-26 22:32 ` [PATCH v4 2/5] hwmon: ltc2945: Add devicetree match table Jonathan Cormier
2023-01-26 22:32 ` [PATCH v4 3/5] hwmon: ltc2945: Handle error case in ltc2945_value_store Jonathan Cormier
2023-01-26 22:32 ` [PATCH v4 4/5] hwmon: ltc2945: Allow setting shunt resistor Jonathan Cormier
2023-01-26 22:32 ` [PATCH v4 5/5] hwmon: ltc2945: Convert division to DIV_ROUND_CLOSEST_ULL Jonathan Cormier
2023-01-29 19:55   ` Guenter Roeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230129195528.GA1418977@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=bduke@criticallink.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jcormier@criticallink.com \
    --cc=jdelvare@suse.com \
    --cc=jpruitt@criticallink.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).