[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1120a755ef714cb1a1c546fa01939b1f@AcuMS.aculab.com>
Date: Fri, 29 Nov 2024 08:26:57 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Jakob Hauser' <jahau@...ketmail.com>
CC: Jonathan Cameron <jic23@...nel.org>, Lars-Peter Clausen <lars@...afoo.de>,
Linus Walleij <linus.walleij@...aro.org>, "linux-iio@...r.kernel.org"
<linux-iio@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, kernel test robot <lkp@...el.com>
Subject: RE: [PATCH] iio: magnetometer: yas530: Use signed integer type for
clamp limits
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)
Powered by blists - more mailing lists