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

From: kernel test robot
Date: Tue Aug 04 2020 - 01:45:38 EST


Hi Crt,

I love your patch! Yet something to improve:

[auto build test ERROR on iio/togreg]
[also build test ERROR on v5.8 next-20200803]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Crt-Mori/iio-temperature-mlx90632-Reduce-number-of-equal-calulcations/20200803-231936
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: x86_64-randconfig-a001-20200803 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 4ffa6a27aca17fe88fa6bdd605b198df6632a570)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> drivers/iio/temperature/mlx90632.c:381:40: error: redefinition of 'TAdut4'
s64 calcedKsTO, calcedKsTA, ir_Alpha, TAdut4, Alpha_corr;
^
drivers/iio/temperature/mlx90632.c:377:28: note: previous definition is here
s64 TAdut, s64 TAdut4, s32 Fa, s32 Fb,
^
>> drivers/iio/temperature/mlx90632.c:412:2: error: use of undeclared identifier 'TAdut4'; did you mean 'TAdut'?
TAdut4 = (div64_s64(TAdut, 10000LL) + 27315) *
^~~~~~
TAdut
drivers/iio/temperature/mlx90632.c:405:17: note: 'TAdut' declared here
s64 kTA, kTA0, TAdut;
^
drivers/iio/temperature/mlx90632.c:419:67: error: use of undeclared identifier 'TAdut4'; did you mean 'TAdut'?
temp = mlx90632_calc_temp_object_iteration(temp, object, TAdut, TAdut4,
^~~~~~
TAdut
drivers/iio/temperature/mlx90632.c:405:17: note: 'TAdut' declared here
s64 kTA, kTA0, TAdut;
^
3 errors generated.

vim +/TAdut4 +381 drivers/iio/temperature/mlx90632.c

c87742abfc80b3 Crt Mori 2018-01-11 375
c87742abfc80b3 Crt Mori 2018-01-11 376 static s32 mlx90632_calc_temp_object_iteration(s32 prev_object_temp, s64 object,
dd5b04efd05f22 Crt Mori 2020-08-03 377 s64 TAdut, s64 TAdut4, s32 Fa, s32 Fb,
c87742abfc80b3 Crt Mori 2018-01-11 378 s32 Ga, s16 Ha, s16 Hb,
c87742abfc80b3 Crt Mori 2018-01-11 379 u16 emissivity)
c87742abfc80b3 Crt Mori 2018-01-11 380 {
c87742abfc80b3 Crt Mori 2018-01-11 @381 s64 calcedKsTO, calcedKsTA, ir_Alpha, TAdut4, Alpha_corr;
c87742abfc80b3 Crt Mori 2018-01-11 382 s64 Ha_customer, Hb_customer;
c87742abfc80b3 Crt Mori 2018-01-11 383
dd5b04efd05f22 Crt Mori 2020-08-03 384 Ha_customer = div64_s64((s64)Ha * 1000000LL, 16384);
dd5b04efd05f22 Crt Mori 2020-08-03 385 Hb_customer = div64_s64((s64)Hb * 100, 1024);
c87742abfc80b3 Crt Mori 2018-01-11 386
dd5b04efd05f22 Crt Mori 2020-08-03 387 calcedKsTO = div64_s64((s64)((s64)Ga * (prev_object_temp - 25 * 1000LL)
dd5b04efd05f22 Crt Mori 2020-08-03 388 * 1000LL), 68719476736);
dd5b04efd05f22 Crt Mori 2020-08-03 389 calcedKsTA = div64_s64((s64)(Fb * (TAdut - 25 * 1000000LL)), 68719476736);
dd5b04efd05f22 Crt Mori 2020-08-03 390 Alpha_corr = div64_s64(div64_s64((s64)(Fa * 10000000000LL), 70368744177664)
dd5b04efd05f22 Crt Mori 2020-08-03 391 * Ha_customer, 1000LL);
c87742abfc80b3 Crt Mori 2018-01-11 392 Alpha_corr *= ((s64)(1 * 1000000LL + calcedKsTO + calcedKsTA));
c87742abfc80b3 Crt Mori 2018-01-11 393 Alpha_corr = emissivity * div64_s64(Alpha_corr, 100000LL);
c87742abfc80b3 Crt Mori 2018-01-11 394 Alpha_corr = div64_s64(Alpha_corr, 1000LL);
c87742abfc80b3 Crt Mori 2018-01-11 395 ir_Alpha = div64_s64((s64)object * 10000000LL, Alpha_corr);
c87742abfc80b3 Crt Mori 2018-01-11 396
c87742abfc80b3 Crt Mori 2018-01-11 397 return (int_sqrt64(int_sqrt64(ir_Alpha * 1000000000000LL + TAdut4))
c87742abfc80b3 Crt Mori 2018-01-11 398 - 27315 - Hb_customer) * 10;
c87742abfc80b3 Crt Mori 2018-01-11 399 }
c87742abfc80b3 Crt Mori 2018-01-11 400
c87742abfc80b3 Crt Mori 2018-01-11 401 static s32 mlx90632_calc_temp_object(s64 object, s64 ambient, s32 Ea, s32 Eb,
c87742abfc80b3 Crt Mori 2018-01-11 402 s32 Fa, s32 Fb, s32 Ga, s16 Ha, s16 Hb,
c87742abfc80b3 Crt Mori 2018-01-11 403 u16 tmp_emi)
c87742abfc80b3 Crt Mori 2018-01-11 404 {
c87742abfc80b3 Crt Mori 2018-01-11 405 s64 kTA, kTA0, TAdut;
c87742abfc80b3 Crt Mori 2018-01-11 406 s64 temp = 25000;
c87742abfc80b3 Crt Mori 2018-01-11 407 s8 i;
c87742abfc80b3 Crt Mori 2018-01-11 408
c87742abfc80b3 Crt Mori 2018-01-11 409 kTA = (Ea * 1000LL) >> 16LL;
c87742abfc80b3 Crt Mori 2018-01-11 410 kTA0 = (Eb * 1000LL) >> 8LL;
c87742abfc80b3 Crt Mori 2018-01-11 411 TAdut = div64_s64(((ambient - kTA0) * 1000000LL), kTA) + 25 * 1000000LL;
dd5b04efd05f22 Crt Mori 2020-08-03 @412 TAdut4 = (div64_s64(TAdut, 10000LL) + 27315) *
dd5b04efd05f22 Crt Mori 2020-08-03 413 (div64_s64(TAdut, 10000LL) + 27315) *
dd5b04efd05f22 Crt Mori 2020-08-03 414 (div64_s64(TAdut, 10000LL) + 27315) *
dd5b04efd05f22 Crt Mori 2020-08-03 415 (div64_s64(TAdut, 10000LL) + 27315);
c87742abfc80b3 Crt Mori 2018-01-11 416
c87742abfc80b3 Crt Mori 2018-01-11 417 /* Iterations of calculation as described in datasheet */
c87742abfc80b3 Crt Mori 2018-01-11 418 for (i = 0; i < 5; ++i) {
dd5b04efd05f22 Crt Mori 2020-08-03 419 temp = mlx90632_calc_temp_object_iteration(temp, object, TAdut, TAdut4,
c87742abfc80b3 Crt Mori 2018-01-11 420 Fa, Fb, Ga, Ha, Hb,
c87742abfc80b3 Crt Mori 2018-01-11 421 tmp_emi);
c87742abfc80b3 Crt Mori 2018-01-11 422 }
c87742abfc80b3 Crt Mori 2018-01-11 423 return temp;
c87742abfc80b3 Crt Mori 2018-01-11 424 }
c87742abfc80b3 Crt Mori 2018-01-11 425

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip