From: kbuild test robot <lkp@intel.com>
To: Robert Lippert <roblip@gmail.com>
Cc: kbuild-all@01.org, linux@roeck-us.net,
linux-hwmon@vger.kernel.org, jdelvare@suse.com,
linux-kernel@vger.kernel.org, xow@google.com,
Robert Lippert <rlippert@google.com>
Subject: Re: [PATCH] hwmon: (pmbus) Use 64bit math for DIRECT format values
Date: Sun, 26 Nov 2017 04:28:08 +0800 [thread overview]
Message-ID: <201711260334.tfqMr69H%fengguang.wu@intel.com> (raw)
In-Reply-To: <20171122220843.18309-1-rlippert@google.com>
[-- Attachment #1: Type: text/plain, Size: 3655 bytes --]
Hi Robert,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on hwmon/hwmon-next]
[also build test WARNING on v4.14 next-20171124]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Robert-Lippert/hwmon-pmbus-Use-64bit-math-for-DIRECT-format-values/20171126-031040
base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa
All warnings (new ones prefixed by >>):
In file included from ./arch/xtensa/include/generated/asm/div64.h:1:0,
from include/linux/kernel.h:173,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from include/linux/debugfs.h:18,
from drivers/hwmon//pmbus/pmbus_core.c:22:
drivers/hwmon//pmbus/pmbus_core.c: In function 'pmbus_reg2data_direct':
include/asm-generic/div64.h:222:28: warning: comparison of distinct pointer types lacks a cast
(void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
^
>> drivers/hwmon//pmbus/pmbus_core.c:531:3: note: in expansion of macro 'do_div'
do_div(val, 10);
^
include/asm-generic/div64.h:222:28: warning: comparison of distinct pointer types lacks a cast
(void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
^
drivers/hwmon//pmbus/pmbus_core.c:536:2: note: in expansion of macro 'do_div'
do_div(val, m);
^
drivers/hwmon//pmbus/pmbus_core.c: In function 'pmbus_data2reg_direct':
include/asm-generic/div64.h:222:28: warning: comparison of distinct pointer types lacks a cast
(void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
^
drivers/hwmon//pmbus/pmbus_core.c:686:3: note: in expansion of macro 'do_div'
do_div(val64, 10);
^
vim +/do_div +531 drivers/hwmon//pmbus/pmbus_core.c
494
495 /*
496 * Convert direct sensor values to milli- or micro-units
497 * depending on sensor type.
498 */
499 static long pmbus_reg2data_direct(struct pmbus_data *data,
500 struct pmbus_sensor *sensor)
501 {
502 s64 val = (s16) sensor->data;
503 s64 m, b, R;
504
505 m = data->info->m[sensor->class];
506 b = data->info->b[sensor->class];
507 R = data->info->R[sensor->class];
508
509 if (m == 0)
510 return 0;
511
512 /* X = 1/m * (Y * 10^-R - b) */
513 R = -R;
514 /* scale result to milli-units for everything but fans */
515 if (sensor->class != PSC_FAN) {
516 R += 3;
517 b *= 1000;
518 }
519
520 /* scale result to micro-units for power sensors */
521 if (sensor->class == PSC_POWER) {
522 R += 3;
523 b *= 1000;
524 }
525
526 while (R > 0) {
527 val *= 10;
528 R--;
529 }
530 while (R < 0) {
> 531 do_div(val, 10);
532 R++;
533 }
534
535 val = val - b;
536 do_div(val, m);
537 return val;
538 }
539
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 51899 bytes --]
next prev parent reply other threads:[~2017-11-25 20:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-22 22:08 Robert Lippert
2017-11-22 22:28 ` Guenter Roeck
2017-11-27 21:42 ` Rob Lippert
2017-11-25 20:28 ` kbuild test robot [this message]
2017-11-27 21:39 ` [PATCH v2] " Robert Lippert
2017-11-27 22:11 ` Guenter Roeck
2017-11-27 23:51 ` Rob Lippert
2017-11-27 23:51 ` [PATCH v3] " Robert Lippert
2017-11-28 4:12 ` [v3] " Guenter Roeck
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=201711260334.tfqMr69H%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=jdelvare@suse.com \
--cc=kbuild-all@01.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=rlippert@google.com \
--cc=roblip@gmail.com \
--cc=xow@google.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
all inboxes | Powered by JetHome®