From: David Laight <David.Laight@ACULAB.COM>
To: 'Jakob Hauser' <jahau@rocketmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Linus Walleij <linus.walleij@linaro.org>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
kernel test robot <lkp@intel.com>
Subject: RE: [PATCH] iio: magnetometer: yas530: Use signed integer type for clamp limits
Date: Fri, 29 Nov 2024 08:26:57 +0000 [thread overview]
Message-ID: <1120a755ef714cb1a1c546fa01939b1f@AcuMS.aculab.com> (raw)
In-Reply-To: <2662b991-bd22-4ff8-b309-77f0e0f6dc86@rocketmail.com>
From: Jakob Hauser
> Sent: 29 November 2024 00:20
...
> > and it should be clamp() not clamp_val().
>
> I assumed that clamp_val() is still needed because according to its
> description in current mainline (6.12) include/linux/minmax.h, clamp()
> does "strict typechecking". The input value h[] is of type s32 and the
> limits derived from "half_range" are of type int. I had a try compiling
> with clamp() and didn't get any warnings or errors. Does that mean that
> clamp() isn't that strict in the current implementation (and considering
> the patch being backported)? Does it just check signedness and is this
> because in current __clamp_once() it uses __auto_type?
The current mainline contains relaxed checks - the comment is wrong.
In any case, after the change, they ate all 'int'.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
prev parent reply other threads:[~2024-11-29 8:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20241126234021.19749-1-jahau.ref@rocketmail.com>
2024-11-26 23:40 ` [PATCH] iio: magnetometer: yas530: Use signed integer type for clamp limits Jakob Hauser
2024-11-27 8:53 ` David Laight
2024-11-29 0:19 ` Jakob Hauser
2024-11-29 8:26 ` David Laight [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=1120a755ef714cb1a1c546fa01939b1f@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=jahau@rocketmail.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.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