Re: [PATCH 5/5] lib/math: remove int_pow()

From: kbuild test robot
Date: Sat Sep 21 2019 - 11:16:38 EST


Hi Rasmus,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.3 next-20190918]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Rasmus-Villemoes/backlight-pwm_bl-fix-cie1913-comments-and-constant/20190919-225123
config: x86_64-randconfig-s0-201937 (attached as .config)
compiler: gcc-5 (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
:::::: branch date: 2 hours ago
:::::: commit date: 2 hours ago

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

All errors (new ones prefixed by >>):

drivers/iio/common/hid-sensors/hid-sensor-attributes.c: In function 'simple_div':
>> drivers/iio/common/hid-sensors/hid-sensor-attributes.c:94:35: error: implicit declaration of function 'int_pow' [-Werror=implicit-function-declaration]
*micro_frac = (rem / divisor) * int_pow(10, 6 - exp);
^
Cyclomatic Complexity 3 include/linux/hid-sensor-hub.h:hid_sensor_convert_exponent
Cyclomatic Complexity 1 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:hid_sensor_convert_timestamp
Cyclomatic Complexity 3 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:hid_sensor_batch_mode_supported
Cyclomatic Complexity 4 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:hid_sensor_read_poll_value
Cyclomatic Complexity 2 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:hid_sensor_get_report_latency
Cyclomatic Complexity 4 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:simple_div
Cyclomatic Complexity 5 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:hid_sensor_read_samp_freq_value
Cyclomatic Complexity 1 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:split_micro_fraction
Cyclomatic Complexity 4 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:convert_from_vtf_format
Cyclomatic Complexity 3 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:hid_sensor_read_raw_hyst_value
Cyclomatic Complexity 4 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:convert_to_vtf_format
Cyclomatic Complexity 7 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:adjust_exponent_nano
Cyclomatic Complexity 4 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:hid_sensor_format_scale
Cyclomatic Complexity 9 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:hid_sensor_write_samp_freq_value
Cyclomatic Complexity 6 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:hid_sensor_write_raw_hyst_value
Cyclomatic Complexity 1 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:hid_sensor_set_report_latency
Cyclomatic Complexity 2 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:hid_sensor_get_reporting_interval
Cyclomatic Complexity 2 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:hid_sensor_get_report_latency_info
Cyclomatic Complexity 6 drivers/iio/common/hid-sensors/hid-sensor-attributes.c:hid_sensor_parse_common_attributes
cc1: some warnings being treated as errors

# https://github.com/0day-ci/linux/commit/d89cf2c7a3840d1691169c9e099c7def0dc16c46
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout d89cf2c7a3840d1691169c9e099c7def0dc16c46
vim +/int_pow +94 drivers/iio/common/hid-sensors/hid-sensor-attributes.c

5d02edfc395744 Srinivas Pandruvada 2014-04-19 75
73c6768b710a16 srinivas pandruvada 2012-09-05 76 static void simple_div(int dividend, int divisor, int *whole,
73c6768b710a16 srinivas pandruvada 2012-09-05 77 int *micro_frac)
73c6768b710a16 srinivas pandruvada 2012-09-05 78 {
73c6768b710a16 srinivas pandruvada 2012-09-05 79 int rem;
73c6768b710a16 srinivas pandruvada 2012-09-05 80 int exp = 0;
73c6768b710a16 srinivas pandruvada 2012-09-05 81
73c6768b710a16 srinivas pandruvada 2012-09-05 82 *micro_frac = 0;
73c6768b710a16 srinivas pandruvada 2012-09-05 83 if (divisor == 0) {
73c6768b710a16 srinivas pandruvada 2012-09-05 84 *whole = 0;
73c6768b710a16 srinivas pandruvada 2012-09-05 85 return;
73c6768b710a16 srinivas pandruvada 2012-09-05 86 }
73c6768b710a16 srinivas pandruvada 2012-09-05 87 *whole = dividend/divisor;
73c6768b710a16 srinivas pandruvada 2012-09-05 88 rem = dividend % divisor;
73c6768b710a16 srinivas pandruvada 2012-09-05 89 if (rem) {
73c6768b710a16 srinivas pandruvada 2012-09-05 90 while (rem <= divisor) {
73c6768b710a16 srinivas pandruvada 2012-09-05 91 rem *= 10;
73c6768b710a16 srinivas pandruvada 2012-09-05 92 exp++;
73c6768b710a16 srinivas pandruvada 2012-09-05 93 }
473d12f7638c93 Andy Shevchenko 2019-06-19 @94 *micro_frac = (rem / divisor) * int_pow(10, 6 - exp);
73c6768b710a16 srinivas pandruvada 2012-09-05 95 }
73c6768b710a16 srinivas pandruvada 2012-09-05 96 }
73c6768b710a16 srinivas pandruvada 2012-09-05 97

:::::: The code at line 94 was first introduced by commit
:::::: 473d12f7638c93acbd9296a8cd455b203d5eb528 iio: hid-sensor-attributes: Convert to use int_pow()

:::::: TO: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
:::::: CC: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: .config.gz