From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
Cc: antoniu.miclaus@analog.com, lars@metafoo.de,
Michael.Hennerich@analog.com, jic23@kernel.org,
dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] iio: adc: ad7625: fix type mismatch in clamp() macro
Date: Mon, 27 Apr 2026 10:31:28 +0300 [thread overview]
Message-ID: <ae8Q0MtuZgMxCOM9@ashevche-desk.local> (raw)
In-Reply-To: <20260425071615.20406-2-giorgitchankvetadze1997@gmail.com>
On Sat, Apr 25, 2026 at 11:16:16AM +0400, Giorgi Tchankvetadze wrote:
> clamp() expects compatible operand types. The period calculation uses
> nanosecond constants, while the local target variable was narrower than
> the upper bound expression.
>
> Make target unsigned long and use unsigned long bounds, including
> NSEC_PER_USEC for the upper limit. This keeps the operands naturally
> aligned without adding casts.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
...
> - u32 target;
> + unsigned long target;
> struct pwm_waveform clk_gate_wf = { }, cnv_wf = { };
> int ret;
Preferred to keep the reversed xmas tree order (no need to resend, hopefully
Jonathan tweaks this whilst applying).
struct pwm_waveform clk_gate_wf = { }, cnv_wf = { };
unsigned long target;
int ret;
--
With Best Regards,
Andy Shevchenko
next parent reply other threads:[~2026-04-27 7:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260425071615.20406-2-giorgitchankvetadze1997@gmail.com>
2026-04-27 7:31 ` Andy Shevchenko [this message]
2026-04-27 9:52 ` [PATCH v2] iio: adc: ad7625: fix type mismatch in clamp() macro Jonathan Cameron
2026-04-27 13:28 ` David Laight
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=ae8Q0MtuZgMxCOM9@ashevche-desk.local \
--to=andriy.shevchenko@linux.intel.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=dlechner@baylibre.com \
--cc=giorgitchankvetadze1997@gmail.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/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