[PATCH v6 0/5] iio: temperature: mlx90632: Add extended calibration calculations

2020-08-18 Thread Crt Mori
should be 40ms which is out of scope of usleep function - Fixing some typos in comments V2 review comments from Andy Shevchenko : - Convert divison back to shifts to make it more readable Crt Mori (5): iio:temperature:mlx90632: Reduce number of equal calulcations

[PATCH v6 2/5] iio:temperature:mlx90632: Add kerneldoc to the internal struct

2020-08-18 Thread Crt Mori
Document internal/private struct for mlx90632 device. Signed-off-by: Crt Mori Reviewed-by: Andy Shevchenko --- drivers/iio/temperature/mlx90632.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c

[PATCH v6 1/5] iio:temperature:mlx90632: Reduce number of equal calulcations

2020-08-18 Thread Crt Mori
TAdut4 was calculated each iteration although it did not change. In light of near future additions of the Extended range DSP calculations, this function refactoring will help reduce unrelated changes in that series as well as reduce the number of new functions needed. Signed-off-by: Crt Mori

[PATCH v6 3/5] iio:temperature:mlx90632: Convert polling while loop to regmap

2020-08-18 Thread Crt Mori
Reduce number of lines and improve readability to convert polling while loops to regmap_read_poll_timeout. Signed-off-by: Crt Mori --- drivers/iio/temperature/mlx90632.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/iio/temperature/mlx90632.c b

[PATCH v6 4/5] iio:temperature:mlx90632: Adding extended calibration option

2020-08-18 Thread Crt Mori
be eliminated. Currently this temperature is fixed at 25, but the interface to adjust it by user (with external sensor or just IR measurement of the other object which acts as ambient), will be introduced in another commit. Signed-off-by: Crt Mori Reviewed-by: Andy Shevchenko --- drivers/iio

[PATCH v6 5/5] iio:temperature:mlx90632: Some stylefixing leftovers

2020-08-18 Thread Crt Mori
There is some inconsistency and whitespace cleanup performed in this patch. It was done on top of my other patches, but I can rebase to head of the togreg branch if it would go in sooner. Signed-off-by: Crt Mori --- drivers/iio/temperature/mlx90632.c | 10 +- 1 file changed, 5

Re: [PATCH v5 3/5] iio:temperature:mlx90632: Convert polling while loop to do-while

2020-08-14 Thread Crt Mori
On Fri, 14 Aug 2020 at 11:32, Andy Shevchenko wrote: > > On Fri, Aug 14, 2020 at 10:33 AM Crt Mori wrote: > > On Thu, 13 Aug 2020 at 21:41, Andy Shevchenko > > wrote: > > > On Thu, Aug 13, 2020 at 4:04 PM Crt Mori wrote: > > > > On Thu, 13 Aug 2020 at

Re: [PATCH v5 3/5] iio:temperature:mlx90632: Convert polling while loop to do-while

2020-08-14 Thread Crt Mori
On Thu, 13 Aug 2020 at 21:41, Andy Shevchenko wrote: > > On Thu, Aug 13, 2020 at 4:04 PM Crt Mori wrote: > > On Thu, 13 Aug 2020 at 13:24, Andy Shevchenko > > wrote: > > > On Thu, Aug 13, 2020 at 2:14 PM Crt Mori wrote: > > > > On Thu, 13 Aug 2020 at

Re: [PATCH v5 5/5] iio:temperature:mlx90632: Some stylefixing leftovers

2020-08-13 Thread Crt Mori
On Thu, 13 Aug 2020 at 13:01, Andy Shevchenko wrote: > > On Thu, Aug 13, 2020 at 10:53 AM Crt Mori wrote: > > > > There is some inconsistency and whitespace cleanup performed in this > > patch. It was done on top of my other patches, but I can rebase to head > > of

Re: [PATCH v5 3/5] iio:temperature:mlx90632: Convert polling while loop to do-while

2020-08-13 Thread Crt Mori
On Thu, 13 Aug 2020 at 13:24, Andy Shevchenko wrote: > > On Thu, Aug 13, 2020 at 2:14 PM Crt Mori wrote: > > > > On Thu, 13 Aug 2020 at 13:03, Andy Shevchenko > > wrote: > > > > > > On Thu, Aug 13, 2020 at 10:53 AM Crt Mori wrote: > > > >

Re: [PATCH v5 3/5] iio:temperature:mlx90632: Convert polling while loop to do-while

2020-08-13 Thread Crt Mori
On Thu, 13 Aug 2020 at 13:03, Andy Shevchenko wrote: > > On Thu, Aug 13, 2020 at 10:53 AM Crt Mori wrote: > > > > Reduce number of lines and improve readability to convert polling while > > loops to do-while. The iopoll.h interface was not used, because we > >

[PATCH v5 0/5] iio: temperature: mlx90632: Add extended calibration calculations

2020-08-13 Thread Crt Mori
should be 40ms which is out of scope of usleep function - Fixing some typos in comments V2 review comments from Andy Shevchenko : - Convert divison back to shifts to make it more readable Crt Mori (5): iio:temperature:mlx90632: Reduce number of equal calulcations

[PATCH v5 2/5] iio:temperature:mlx90632: Add kerneldoc to the internal struct

2020-08-13 Thread Crt Mori
Document internal/private struct for mlx90632 device. Signed-off-by: Crt Mori --- drivers/iio/temperature/mlx90632.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c index c3de10ba5b1e

[PATCH v5 3/5] iio:temperature:mlx90632: Convert polling while loop to do-while

2020-08-13 Thread Crt Mori
currently is 3). Signed-off-by: Crt Mori --- drivers/iio/temperature/mlx90632.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c index ce75f5a3486b..d87c792b7e72 100644 --- a/drivers/iio/temperature

[PATCH v5 1/5] iio:temperature:mlx90632: Reduce number of equal calulcations

2020-08-13 Thread Crt Mori
TAdut4 was calculated each iteration although it did not change. In light of near future additions of the Extended range DSP calculations, this function refactoring will help reduce unrelated changes in that series as well as reduce the number of new functions needed. Signed-off-by: Crt Mori

[PATCH v5 5/5] iio:temperature:mlx90632: Some stylefixing leftovers

2020-08-13 Thread Crt Mori
There is some inconsistency and whitespace cleanup performed in this patch. It was done on top of my other patches, but I can rebase to head of the togreg branch if it would go in sooner. Signed-off-by: Crt Mori --- drivers/iio/temperature/mlx90632.c | 41 -- 1 file

[PATCH v5 4/5] iio:temperature:mlx90632: Adding extended calibration option

2020-08-13 Thread Crt Mori
be eliminated. Currently this temperature is fixed at 25, but the interface to adjust it by user (with external sensor or just IR measurement of the other object which acts as ambient), will be introduced in another commit. Signed-off-by: Crt Mori --- drivers/iio/temperature/mlx90632.c | 224

Re: [PATCH v4 2/4] iio:temperature:mlx90632: Adding extended calibration option

2020-08-11 Thread Crt Mori
On Sun, 9 Aug 2020 at 23:05, Crt Mori wrote: > > On Sun, 9 Aug 2020 at 15:32, Jonathan Cameron wrote: > > > > On Sat, 8 Aug 2020 23:57:59 +0200 > > Crt Mori wrote: > > > > > Hi, > > > I am very sorry you missed them, I thought you saw it (

Re: [PATCH v4 2/4] iio:temperature:mlx90632: Adding extended calibration option

2020-08-09 Thread Crt Mori
On Sun, 9 Aug 2020 at 15:32, Jonathan Cameron wrote: > > On Sat, 8 Aug 2020 23:57:59 +0200 > Crt Mori wrote: > > > Hi, > > I am very sorry you missed them, I thought you saw it (reply on v3 of > > the patch). Maybe something happened to that mail, as it contain

Re: [PATCH v4 2/4] iio:temperature:mlx90632: Adding extended calibration option

2020-08-08 Thread Crt Mori
2020 at 22:04, Andy Shevchenko wrote: > > On Sat, Aug 8, 2020 at 3:11 PM Crt Mori wrote: > > > > For some time the market wants medical grade accuracy in medical range, > > while still retaining the declared accuracy outside of the medical range > > within the same

[PATCH v4 2/4] iio:temperature:mlx90632: Adding extended calibration option

2020-08-08 Thread Crt Mori
be eliminated. Currently this temperature is fixed at 25, but the interface to adjust it by user (with external sensor or just IR measurement of the other object which acts as ambient), will be introduced in another commit. Signed-off-by: Crt Mori --- drivers/iio/temperature/mlx90632.c | 212

[PATCH v4 4/4] iio:temperature:mlx90632: Convert polling while loops to do-while

2020-08-08 Thread Crt Mori
currently is 3). Signed-off-by: Crt Mori --- drivers/iio/temperature/mlx90632.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c index 4e0131705c11..24ffcce9ad74 100644 --- a/drivers/iio

[PATCH v4 3/4] iio:temperature:mlx90632: Add kerneldoc to the internal struct

2020-08-08 Thread Crt Mori
Document internal/private struct for mlx90632 device. Signed-off-by: Crt Mori --- drivers/iio/temperature/mlx90632.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c index 049c1217a166

[PATCH v4 1/4] iio:temperature:mlx90632: Reduce number of equal calulcations

2020-08-08 Thread Crt Mori
TAdut4 was calculated each iteration although it did not change. In light of near future additions of the Extended range DSP calculations, this function refactoring will help reduce unrelated changes in that series as well as reduce the number of new functions needed. Signed-off-by: Crt Mori

[PATCH v4 0/4] iio: temperature: mlx90632: Add extended calibration calculations

2020-08-08 Thread Crt Mori
to make it more readable Crt Mori (4): iio:temperature:mlx90632: Reduce number of equal calulcations iio:temperature:mlx90632: Adding extended calibration option iio:temperature:mlx90632: Add kerneldoc to the internal struct iio:temperature:mlx90632: Convert polling while loops to do-while

Re: [PATCH v3 2/2] iio:temperature:mlx90632: Adding extended calibration option

2020-08-08 Thread Crt Mori
On Sat, 8 Aug 2020 at 12:44, Andy Shevchenko wrote: > > On Sat, Aug 8, 2020 at 2:24 AM Crt Mori wrote: > > > > For some time the market wants medical grade accuracy in medical range, > > while still retaining the declared accuracy outside of the medical range &g

[PATCH v3 1/2] iio:temperature:mlx90632: Reduce number of equal calulcations

2020-08-07 Thread Crt Mori
TAdut4 was calculated each iteration although it did not change. In light of near future additions of the Extended range DSP calculations, this function refactoring will help reduce unrelated changes in that series as well as reduce the number of new functions needed. Signed-off-by: Crt Mori

[PATCH v3 0/2] iio: temperature: mlx90632: Add extended calibration calculations

2020-08-07 Thread Crt Mori
Since the second patch is dependent on the first and was still not merged, I have decided to send them together. First patch just makes second one more readable as it splits out the repeated calculation and that enables the second patch to tweak the variable to the new condition. Crt Mori (2

[PATCH v3 2/2] iio:temperature:mlx90632: Adding extended calibration option

2020-08-07 Thread Crt Mori
be eliminated. Currently this temperature is fixed at 25, but the interface to adjust it by user (with external sensor or just IR measurement of the other object which acts as ambient), will be introduced in another commit. Signed-off-by: Crt Mori --- drivers/iio/temperature/mlx90632.c | 225

Re: [PATCH 2/2 resend] iio:temperature:mlx90632: Adding extended calibration option

2020-08-07 Thread Crt Mori
On Fri, 7 Aug 2020 at 13:13, Crt Mori wrote: > > On Fri, 7 Aug 2020 at 12:29, Andy Shevchenko > wrote: > > > > On Fri, Aug 7, 2020 at 12:21 PM Crt Mori wrote: > > > > Oh yeah, you are right, there will be some comments :-) > > > > Told ya. No ma

Re: [PATCH 2/2 resend] iio:temperature:mlx90632: Adding extended calibration option

2020-08-07 Thread Crt Mori
On Fri, 7 Aug 2020 at 12:29, Andy Shevchenko wrote: > > On Fri, Aug 7, 2020 at 12:21 PM Crt Mori wrote: > > Oh yeah, you are right, there will be some comments :-) > Told ya. No matter how many times I go through it, I always find something. I will prepare v3 with fixes,

Re: [PATCH 0/2] iio: temperature: mlx90632: Add extended calibration calculations

2020-08-07 Thread Crt Mori
On Fri, 7 Aug 2020 at 11:29, Andy Shevchenko wrote: > > On Fri, Aug 7, 2020 at 12:22 PM Crt Mori wrote: > > > > Since the second patch is dependent on the first and was still not > > merged, I have decided to send them together. First patch just makes > > second

[PATCH 2/2 resend] iio:temperature:mlx90632: Adding extended calibration option

2020-08-07 Thread Crt Mori
be eliminated. Currently this temperature is fixed at 25, but interface to adjust it by user (with external sensor or just IR measurement of the another object which acts as ambient), will be introduced in another commit. Signed-off-by: Crt Mori --- drivers/iio/temperature/mlx90632.c | 219

[PATCH 1/2 v2 resend] iio:temperature:mlx90632: Reduce number of equal calulcations

2020-08-07 Thread Crt Mori
TAdut4 was calculated each iteration although it did not change. In light of near future additions of the Extended range DSP calculations, this function refactoring will help reduce unrelated changes in that series as well as reduce the number of new functions needed. Signed-off-by: Crt Mori

[PATCH 0/2] iio: temperature: mlx90632: Add extended calibration calculations

2020-08-07 Thread Crt Mori
Since the second patch is dependent on the first and was still not merged, I have decided to send them together. First patch just makes second one more readable as it splits out the repeated calculation and that enables the second patch to tweak the variable to the new condition. Crt Mori (2

[PATCH] iio:temperature:mlx90632: Some stylefixing leftovers

2020-08-06 Thread Crt Mori
There is some inconsistency and whitespace cleanup performed in this patch. It was done on top of my other patches, but I can rebase to head of the togreg branch if it would go in sooner. Signed-off-by: Crt Mori --- drivers/iio/temperature/mlx90632.c | 10 +- 1 file changed, 5

[PATCH] iio:temperature:mlx90632: Adding extended calibration option

2020-08-06 Thread Crt Mori
be eliminated. Currently this temperature is fixed at 25, but interface to adjust it by user (with external sensor or just IR measurement of the another object which acts as ambient), will be introduced in another commit. Signed-off-by: Crt Mori --- drivers/iio/temperature/mlx90632.c | 219

[PATCH v2] iio:temperature:mlx90632: Reduce number of equal calculations

2020-08-04 Thread Crt Mori
TAdut4 was calculated each iteration although it did not change. In light of near future additions of the Extended range DSP calculations, this function refactoring will help reduce unrelated changes in that series as well as reduce the number of new functions needed. Signed-off-by: Crt Mori

Re: [PATCH] iio:temperature:mlx90632: Reduce number of equal calulcations

2020-08-04 Thread Crt Mori
Hi Andy, Thanks for the comments. This is indeed a cut-out section of what I wanted to submit next. On Mon, 3 Aug 2020 at 18:35, Andy Shevchenko wrote: > > On Mon, Aug 3, 2020 at 6:17 PM Crt Mori wrote: > > > > TAdut4 was calculated each iteration although it did no

[PATCH] iio:temperature:mlx90632: Reduce number of equal calulcations

2020-08-03 Thread Crt Mori
in this function of signed integers to divisions as that is less implementation-defined behavior. Signed-off-by: Crt Mori --- drivers/iio/temperature/mlx90632.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/iio/temperature/mlx90632.c b/drivers

Re: [PATCH 09/30] iio: temperature: mlx90632: Function parameter descriptions must match exactly

2020-07-17 Thread Crt Mori
Acked-by: Crt Mori On Fri, 17 Jul 2020 at 18:56, Lee Jones wrote: > > '*'s are not welcome in kerneldoc parameter names. > > Fixes the following W=1 kernel build warning(s): > > drivers/iio/temperature/mlx90632.c:175: warning: Function parameter or > member

Re: fix int_sqrt() for very large numbers

2019-01-21 Thread Crt Mori
On Mon, 21 Jan 2019 at 01:20, Linus Torvalds wrote: > > On Sun, Jan 20, 2019 at 4:15 AM Florian La Roche > wrote: > > > > @@ -52,7 +52,7 @@ u32 int_sqrt64(u64 x) > > if (x <= ULONG_MAX) > > return int_sqrt((unsigned long) x); > > > > - m = 1ULL << (fls64(x) &

Re: fix int_sqrt() for very large numbers

2019-01-20 Thread Crt Mori
On Sun, 20 Jan 2019 at 09:31, Crt Mori wrote: > > On Sun, 20 Jan 2019 at 04:49, Linus Torvalds > wrote: > > > > On Sun, Jan 20, 2019 at 12:01 PM Will Deacon wrote: > > > > > > > @@ -52,7 +52,7 @@ u32 int_sqrt64(u64 x) > > > > if

Re: fix int_sqrt() for very large numbers

2019-01-20 Thread Crt Mori
On Sun, 20 Jan 2019 at 04:49, Linus Torvalds wrote: > > On Sun, Jan 20, 2019 at 12:01 PM Will Deacon wrote: > > > > > @@ -52,7 +52,7 @@ u32 int_sqrt64(u64 x) > > > if (x <= ULONG_MAX) > > > return int_sqrt((unsigned long) x); > > > > > > - m = 1ULL << (fls64(x) & ~1ULL);

Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2018-01-15 Thread Crt Mori
On 12 January 2018 at 10:41, David Laight <david.lai...@aculab.com> wrote: > From: Crt Mori [mailto:c...@melexis.com] >> Sent: 09 January 2018 15:18 >> >> It has been some time now since this moved. I have decided not to use >> David's implementation because I

Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2018-01-15 Thread Crt Mori
On 12 January 2018 at 10:41, David Laight wrote: > From: Crt Mori [mailto:c...@melexis.com] >> Sent: 09 January 2018 15:18 >> >> It has been some time now since this moved. I have decided not to use >> David's implementation because I want to maintain also range above &

[PATCH v13 1/3] lib: Add strongly typed 64bit int_sqrt

2018-01-11 Thread Crt Mori
performance. In case values are smaller than ULONG_MAX the standard int_sqrt is used for calculation to maximize the performance due to more native calculations. Signed-off-by: Crt Mori <c...@melexis.com> --- include/linux/kernel.h | 9 + lib/int_sqrt.c

[PATCH v13 1/3] lib: Add strongly typed 64bit int_sqrt

2018-01-11 Thread Crt Mori
performance. In case values are smaller than ULONG_MAX the standard int_sqrt is used for calculation to maximize the performance due to more native calculations. Signed-off-by: Crt Mori --- include/linux/kernel.h | 9 + lib/int_sqrt.c | 31 +++ 2 files

[PATCH v13 0/3] iio: temperataure: MLX90632

2018-01-11 Thread Crt Mori
, because we changed the function to newer int_sqrt in past versions. v12 Simplification of the mlx90632 PM flow v13 Use int_sqrt when values are smaller than ULONG_MAX as per Joe Perches suggestion. Adjustment of PM flow with adding a pm_runtime_disable in probe. Crt Mori (3): lib: Add

[PATCH v13 0/3] iio: temperataure: MLX90632

2018-01-11 Thread Crt Mori
, because we changed the function to newer int_sqrt in past versions. v12 Simplification of the mlx90632 PM flow v13 Use int_sqrt when values are smaller than ULONG_MAX as per Joe Perches suggestion. Adjustment of PM flow with adding a pm_runtime_disable in probe. Crt Mori (3): lib: Add

Re: [PATCH v12 1/3] lib: Add strongly typed 64bit int_sqrt

2018-01-10 Thread Crt Mori
On 10 January 2018 at 09:33, Crt Mori <c...@melexis.com> wrote: > On 10 January 2018 at 09:15, Crt Mori <c...@melexis.com> wrote: >> On 9 January 2018 at 20:23, Joe Perches <j...@perches.com> wrote: >>> On Tue, 2018-01-09 at 16:18 +0100, Crt Mori wrote: >

Re: [PATCH v12 1/3] lib: Add strongly typed 64bit int_sqrt

2018-01-10 Thread Crt Mori
On 10 January 2018 at 09:33, Crt Mori wrote: > On 10 January 2018 at 09:15, Crt Mori wrote: >> On 9 January 2018 at 20:23, Joe Perches wrote: >>> On Tue, 2018-01-09 at 16:18 +0100, Crt Mori wrote: >>>> There is no option to perform 64bit integer sqrt on 32bit platf

Re: [PATCH v12 1/3] lib: Add strongly typed 64bit int_sqrt

2018-01-10 Thread Crt Mori
On 10 January 2018 at 09:15, Crt Mori <c...@melexis.com> wrote: > On 9 January 2018 at 20:23, Joe Perches <j...@perches.com> wrote: >> On Tue, 2018-01-09 at 16:18 +0100, Crt Mori wrote: >>> There is no option to perform 64bit integer sqrt on 32bit platform. >&

Re: [PATCH v12 1/3] lib: Add strongly typed 64bit int_sqrt

2018-01-10 Thread Crt Mori
On 10 January 2018 at 09:15, Crt Mori wrote: > On 9 January 2018 at 20:23, Joe Perches wrote: >> On Tue, 2018-01-09 at 16:18 +0100, Crt Mori wrote: >>> There is no option to perform 64bit integer sqrt on 32bit platform. >>> Added stronger typed int_sqrt64 ena

Re: [PATCH v12 1/3] lib: Add strongly typed 64bit int_sqrt

2018-01-10 Thread Crt Mori
On 9 January 2018 at 20:23, Joe Perches <j...@perches.com> wrote: > On Tue, 2018-01-09 at 16:18 +0100, Crt Mori wrote: >> There is no option to perform 64bit integer sqrt on 32bit platform. >> Added stronger typed int_sqrt64 enables the 64bit calculations to >> be p

Re: [PATCH v12 1/3] lib: Add strongly typed 64bit int_sqrt

2018-01-10 Thread Crt Mori
On 9 January 2018 at 20:23, Joe Perches wrote: > On Tue, 2018-01-09 at 16:18 +0100, Crt Mori wrote: >> There is no option to perform 64bit integer sqrt on 32bit platform. >> Added stronger typed int_sqrt64 enables the 64bit calculations to >> be performed on 32bit platforms.

[PATCH v12 1/3] lib: Add strongly typed 64bit int_sqrt

2018-01-09 Thread Crt Mori
performance. Signed-off-by: Crt Mori <c...@melexis.com> --- include/linux/kernel.h | 9 + lib/int_sqrt.c | 32 2 files changed, 41 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 0ad4c3044cf9..e4a3dc64e650

[PATCH v12 1/3] lib: Add strongly typed 64bit int_sqrt

2018-01-09 Thread Crt Mori
performance. Signed-off-by: Crt Mori --- include/linux/kernel.h | 9 + lib/int_sqrt.c | 32 2 files changed, 41 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 0ad4c3044cf9..e4a3dc64e650 100644 --- a/include/linux

Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2018-01-09 Thread Crt Mori
It has been some time now since this moved. I have decided not to use David's implementation because I want to maintain also range above 2^62 Are there any additional objections for this not to go in as it is? On 22 December 2017 at 14:44, Crt Mori <c...@melexis.com> wrote: > >

Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2018-01-09 Thread Crt Mori
It has been some time now since this moved. I have decided not to use David's implementation because I want to maintain also range above 2^62 Are there any additional objections for this not to go in as it is? On 22 December 2017 at 14:44, Crt Mori wrote: > > From simple strong

[PATCH v12 0/3] iio: temperataure: MLX90632

2018-01-09 Thread Crt Mori
, because we changed the function to newer int_sqrt in past versions. v12 Simplification of the mlx90632 PM flow Crt Mori (3): lib: Add strongly typed 64bit int_sqrt dt-bindings: iio: temperature: add MLX90632 device bindings iio: temperature: Adding support for MLX90632 .../bindings/iio

[PATCH v12 0/3] iio: temperataure: MLX90632

2018-01-09 Thread Crt Mori
, because we changed the function to newer int_sqrt in past versions. v12 Simplification of the mlx90632 PM flow Crt Mori (3): lib: Add strongly typed 64bit int_sqrt dt-bindings: iio: temperature: add MLX90632 device bindings iio: temperature: Adding support for MLX90632 .../bindings/iio

Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-22 Thread Crt Mori
>From simple strong typing of existing int_sqrt we came to something a bit more complex or better. Can we decide now which we want in, or I submit v12 and we decide then (although it is not a v12, but whole new thing)? On 21 December 2017 at 15:48, David Laight wrote: >

Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-22 Thread Crt Mori
>From simple strong typing of existing int_sqrt we came to something a bit more complex or better. Can we decide now which we want in, or I submit v12 and we decide then (although it is not a v12, but whole new thing)? On 21 December 2017 at 15:48, David Laight wrote: > From: Peter Zijlstra >>

Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-21 Thread Crt Mori
On 21 December 2017 at 12:43, David Laight <david.lai...@aculab.com> wrote: > From: Crt Mori >> Sent: 20 December 2017 17:30 >> I did a quick run through unit tests for the sensor and the results >> are way off >> ... > > Try this version instead: > u

Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-21 Thread Crt Mori
On 21 December 2017 at 12:43, David Laight wrote: > From: Crt Mori >> Sent: 20 December 2017 17:30 >> I did a quick run through unit tests for the sensor and the results >> are way off >> ... > > Try this version instead: > unsigned int sqrt64(unsigned long lon

Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
On 20 December 2017 at 17:46, David Laight <david.lai...@aculab.com> wrote: > From: Crt Mori >> Sent: 20 December 2017 16:17 >> >> On 20 December 2017 at 17:00, Peter Zijlstra <pet...@infradead.org> wrote: >> > On Wed, Dec 20, 2017 at 02:39:26PM +,

Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
On 20 December 2017 at 17:46, David Laight wrote: > From: Crt Mori >> Sent: 20 December 2017 16:17 >> >> On 20 December 2017 at 17:00, Peter Zijlstra wrote: >> > On Wed, Dec 20, 2017 at 02:39:26PM +, David Laight wrote: >> > >> >> With m

Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
On 20 December 2017 at 17:00, Peter Zijlstra wrote: > On Wed, Dec 20, 2017 at 02:39:26PM +, David Laight wrote: > >> With minor changes it ought to be possible to remove most of the >> 64bit arithmetic and shifts. >> >> If you care about performance then using 32 bit

Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
On 20 December 2017 at 17:00, Peter Zijlstra wrote: > On Wed, Dec 20, 2017 at 02:39:26PM +, David Laight wrote: > >> With minor changes it ought to be possible to remove most of the >> 64bit arithmetic and shifts. >> >> If you care about performance then using 32 bit maths will be much

[PATCH v11 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
performance. Signed-off-by: Crt Mori <c...@melexis.com> --- include/linux/kernel.h | 9 + lib/int_sqrt.c | 31 +++ 2 files changed, 40 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 0ad4c3044cf9..e4a3dc64e650

[PATCH v11 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
performance. Signed-off-by: Crt Mori --- include/linux/kernel.h | 9 + lib/int_sqrt.c | 31 +++ 2 files changed, 40 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 0ad4c3044cf9..e4a3dc64e650 100644 --- a/include/linux

[PATCH v11 0/3] iio: temperataure: MLX90632

2017-12-20 Thread Crt Mori
, because we changed the function to newer int_sqrt in past versions. Crt Mori (3): lib: Add strongly typed 64bit int_sqrt dt-bindings: iio: temperature: add MLX90632 device bindings iio: temperature: Adding support for MLX90632 .../bindings/iio/temperature/mlx90632.txt | 28

[PATCH v11 0/3] iio: temperataure: MLX90632

2017-12-20 Thread Crt Mori
, because we changed the function to newer int_sqrt in past versions. Crt Mori (3): lib: Add strongly typed 64bit int_sqrt dt-bindings: iio: temperature: add MLX90632 device bindings iio: temperature: Adding support for MLX90632 .../bindings/iio/temperature/mlx90632.txt | 28

Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
On 20 December 2017 at 15:39, David Laight <david.lai...@aculab.com> wrote: > From: Crt Mori >> Sent: 20 December 2017 14:20 >> >> There is no option to perform 64bit integer sqrt on 32bit platform. >> Added stronger typed int_sqrt64 enables the 64bit calcula

Re: [PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
On 20 December 2017 at 15:39, David Laight wrote: > From: Crt Mori >> Sent: 20 December 2017 14:20 >> >> There is no option to perform 64bit integer sqrt on 32bit platform. >> Added stronger typed int_sqrt64 enables the 64bit calculations to >> be performed on 3

Re: [PATCH v9 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
On 20 December 2017 at 10:56, Joe Perches <j...@perches.com> wrote: > On Wed, 2017-12-20 at 10:33 +0100, Crt Mori wrote: >> There is no option to perform 64bit integer sqrt on 32bit platform. >> Added stronger typed int_sqrt64 enables the 64bit calculations to >> be p

Re: [PATCH v9 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
On 20 December 2017 at 10:56, Joe Perches wrote: > On Wed, 2017-12-20 at 10:33 +0100, Crt Mori wrote: >> There is no option to perform 64bit integer sqrt on 32bit platform. >> Added stronger typed int_sqrt64 enables the 64bit calculations to >> be performed on 32bit platfor

[PATCH v10 0/3] iio: temperataure: MLX90632

2017-12-20 Thread Crt Mori
with adjustment to int_sqrt changes from Peter Zijlstra for int_sqrt64 function. Also replaced the macro magic with a simple ifdef in source file. v10 Put defintion for int_sqrt64 for 64 bit machines into the header file as per suggestion of Joe Perches Crt Mori (3): lib: Add strongly typed 64bit

[PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
-off-by: Crt Mori <c...@melexis.com> --- include/linux/kernel.h | 9 + lib/int_sqrt.c | 31 +++ 2 files changed, 40 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 0ad4c3044cf9..e4a3dc64e650 100644 --- a/include

[PATCH v10 0/3] iio: temperataure: MLX90632

2017-12-20 Thread Crt Mori
with adjustment to int_sqrt changes from Peter Zijlstra for int_sqrt64 function. Also replaced the macro magic with a simple ifdef in source file. v10 Put defintion for int_sqrt64 for 64 bit machines into the header file as per suggestion of Joe Perches Crt Mori (3): lib: Add strongly typed 64bit

[PATCH v10 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
-off-by: Crt Mori --- include/linux/kernel.h | 9 + lib/int_sqrt.c | 31 +++ 2 files changed, 40 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 0ad4c3044cf9..e4a3dc64e650 100644 --- a/include/linux/kernel.h +++ b

Re: [PATCH v7 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
Thanks for suggestions and comments. Respinned v9 with them. On 19 December 2017 at 17:14, Joe Perches wrote: > On Tue, 2017-12-19 at 17:12 +0100, Peter Zijlstra wrote: >> On Tue, Dec 19, 2017 at 08:09:53AM -0800, Joe Perches wrote: >> > >> > I suspect you need to define this

Re: [PATCH v7 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
Thanks for suggestions and comments. Respinned v9 with them. On 19 December 2017 at 17:14, Joe Perches wrote: > On Tue, 2017-12-19 at 17:12 +0100, Peter Zijlstra wrote: >> On Tue, Dec 19, 2017 at 08:09:53AM -0800, Joe Perches wrote: >> > >> > I suspect you need to define this as: >> > >> >

[PATCH v9 0/3] iio: temperataure: MLX90632

2017-12-20 Thread Crt Mori
with adjustment to int_sqrt changes from Peter Zijlstra for int_sqrt64 function. Also replaced the macro magic with a simple ifdef in source file. Crt Mori (3): lib: Add strongly typed 64bit int_sqrt dt-bindings: iio: temperature: add MLX90632 device bindings iio: temperature: Adding support

[PATCH v9 0/3] iio: temperataure: MLX90632

2017-12-20 Thread Crt Mori
with adjustment to int_sqrt changes from Peter Zijlstra for int_sqrt64 function. Also replaced the macro magic with a simple ifdef in source file. Crt Mori (3): lib: Add strongly typed 64bit int_sqrt dt-bindings: iio: temperature: add MLX90632 device bindings iio: temperature: Adding support

[PATCH v9 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
-off-by: Crt Mori <c...@melexis.com> --- include/linux/kernel.h | 1 + lib/int_sqrt.c | 37 + 2 files changed, 38 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 0ad4c3044cf9..5c6949e9e309 100644 --- a/include

[PATCH v9 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-20 Thread Crt Mori
-off-by: Crt Mori --- include/linux/kernel.h | 1 + lib/int_sqrt.c | 37 + 2 files changed, 38 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 0ad4c3044cf9..5c6949e9e309 100644 --- a/include/linux/kernel.h +++ b/include

[PATCH v8 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-19 Thread Crt Mori
-off-by: Crt Mori <c...@melexis.com> --- include/linux/kernel.h | 6 ++ lib/int_sqrt.c | 31 +++ 2 files changed, 37 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 0ad4c3044cf9..f3bebd3a9213 100644 --- a/include

[PATCH v8 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-19 Thread Crt Mori
-off-by: Crt Mori --- include/linux/kernel.h | 6 ++ lib/int_sqrt.c | 31 +++ 2 files changed, 37 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 0ad4c3044cf9..f3bebd3a9213 100644 --- a/include/linux/kernel.h +++ b/include

[PATCH v8 0/3] iio: temperataure: MLX90632

2017-12-19 Thread Crt Mori
macro for PM function mapping. v7 Rework usage of int_sqrt according to Joe Perches and fixing return size to u32 as per Peter Zijlstra suggestion, as sqrt of 64bit number cannot be have more than 32bits. v8 Small style fixup in the comment Crt Mori (3): lib: Add strongly typed 64bit int_sqrt

[PATCH v8 0/3] iio: temperataure: MLX90632

2017-12-19 Thread Crt Mori
macro for PM function mapping. v7 Rework usage of int_sqrt according to Joe Perches and fixing return size to u32 as per Peter Zijlstra suggestion, as sqrt of 64bit number cannot be have more than 32bits. v8 Small style fixup in the comment Crt Mori (3): lib: Add strongly typed 64bit int_sqrt

[PATCH v7 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-19 Thread Crt Mori
-off-by: Crt Mori <c...@melexis.com> --- include/linux/kernel.h | 6 ++ lib/int_sqrt.c | 32 2 files changed, 38 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 0ad4c3044cf9..f3bebd3a9213 100644 --- a/include

[PATCH v7 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-19 Thread Crt Mori
-off-by: Crt Mori --- include/linux/kernel.h | 6 ++ lib/int_sqrt.c | 32 2 files changed, 38 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 0ad4c3044cf9..f3bebd3a9213 100644 --- a/include/linux/kernel.h +++ b/include

[PATCH v7 0/3] iio: temperataure: MLX90632

2017-12-19 Thread Crt Mori
macro for PM function mapping. v7 Rework usage of int_sqrt according to Joe Perches and fixing return size to u32 as per Peter Zijlstra suggestion, as sqrt of 64bit number cannot be have more than 32bits. Crt Mori (3): lib: Add strongly typed 64bit int_sqrt dt-bindings: iio: temperature: add

[PATCH v7 0/3] iio: temperataure: MLX90632

2017-12-19 Thread Crt Mori
macro for PM function mapping. v7 Rework usage of int_sqrt according to Joe Perches and fixing return size to u32 as per Peter Zijlstra suggestion, as sqrt of 64bit number cannot be have more than 32bits. Crt Mori (3): lib: Add strongly typed 64bit int_sqrt dt-bindings: iio: temperature: add

Re: [PATCH v6 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-19 Thread Crt Mori
On 19 December 2017 at 14:25, Peter Zijlstra <pet...@infradead.org> wrote: > On Tue, Dec 19, 2017 at 10:31:18AM +0100, Crt Mori wrote: >> IIO kernel does not have the recent version in, so thanks for heads > > IIO? > Industrial Input / Output Subsytem tree >> up.

Re: [PATCH v6 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-19 Thread Crt Mori
On 19 December 2017 at 14:25, Peter Zijlstra wrote: > On Tue, Dec 19, 2017 at 10:31:18AM +0100, Crt Mori wrote: >> IIO kernel does not have the recent version in, so thanks for heads > > IIO? > Industrial Input / Output Subsytem tree >> up. It does not cha

Re: [PATCH v6 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-19 Thread Crt Mori
On 18 December 2017 at 17:24, Joe Perches <j...@perches.com> wrote: > On Mon, 2017-12-18 at 16:05 +0100, Crt Mori wrote: >> There is no option to perform 64bit integer sqrt on 32bit platform. >> Added stronger typed int_sqrt64 enables the 64bit calculations to >> be p

Re: [PATCH v6 1/3] lib: Add strongly typed 64bit int_sqrt

2017-12-19 Thread Crt Mori
On 18 December 2017 at 17:24, Joe Perches wrote: > On Mon, 2017-12-18 at 16:05 +0100, Crt Mori wrote: >> There is no option to perform 64bit integer sqrt on 32bit platform. >> Added stronger typed int_sqrt64 enables the 64bit calculations to >> be performed on 32bit platfor

  1   2   >