lkml.org 
[lkml]   [2020]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8] hwmon:Driver for Delta power supplies Q54SJ108A2
Hi "xiao.ma",

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on hwmon/hwmon-next]
[also build test WARNING on v5.10-rc3 next-20201110]
[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/xiao-ma/hwmon-Driver-for-Delta-power-supplies-Q54SJ108A2/20201109-153125
base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: powerpc-randconfig-r024-20201110 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 4d81c8adb6ed9840257f6cb6b93f60856d422a15)
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 powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://github.com/0day-ci/linux/commit/f47495409701f52f17c950668c73b20ba8ab3f66
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review xiao-ma/hwmon-Driver-for-Delta-power-supplies-Q54SJ108A2/20201109-153125
git checkout f47495409701f52f17c950668c73b20ba8ab3f66
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc

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

All warnings (new ones prefixed by >>):

In file included from include/linux/kernel_stat.h:9:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:10:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:604:
arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:127:1: note: expanded from here
__do_insl
^
arch/powerpc/include/asm/io.h:543:56: note: expanded from macro '__do_insl'
#define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/hwmon/pmbus/q54sj108a2.c:13:
In file included from drivers/hwmon/pmbus/pmbus.h:13:
In file included from include/linux/regulator/driver.h:18:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:26:
In file included from include/linux/kernel_stat.h:9:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:10:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:604:
arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:129:1: note: expanded from here
__do_outsb
^
arch/powerpc/include/asm/io.h:544:58: note: expanded from macro '__do_outsb'
#define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/hwmon/pmbus/q54sj108a2.c:13:
In file included from drivers/hwmon/pmbus/pmbus.h:13:
In file included from include/linux/regulator/driver.h:18:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:26:
In file included from include/linux/kernel_stat.h:9:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:10:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:604:
arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:131:1: note: expanded from here
__do_outsw
^
arch/powerpc/include/asm/io.h:545:58: note: expanded from macro '__do_outsw'
#define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/hwmon/pmbus/q54sj108a2.c:13:
In file included from drivers/hwmon/pmbus/pmbus.h:13:
In file included from include/linux/regulator/driver.h:18:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:26:
In file included from include/linux/kernel_stat.h:9:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:10:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:604:
arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:133:1: note: expanded from here
__do_outsl
^
arch/powerpc/include/asm/io.h:546:58: note: expanded from macro '__do_outsl'
#define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
>> drivers/hwmon/pmbus/q54sj108a2.c:293:13: warning: cast to smaller integer type 'enum chips' from 'const void *' [-Wvoid-pointer-to-enum-cast]
chip_id = (enum chips)of_device_get_match_data(dev);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hwmon/pmbus/q54sj108a2.c:333:56: error: too many arguments to function call, expected 2, have 3
ret = pmbus_do_probe(client, &q54sj108a2_id[chip_id], &q54sj108a2_info[chip_id]);
~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hwmon/pmbus/pmbus.h:492:5: note: 'pmbus_do_probe' declared here
int pmbus_do_probe(struct i2c_client *client, struct pmbus_driver_info *info);
^
13 warnings and 1 error generated.

vim +293 drivers/hwmon/pmbus/q54sj108a2.c

275
276 static int q54sj108a2_probe(struct i2c_client *client)
277 {
278 struct device *dev = &client->dev;
279 u8 buf[I2C_SMBUS_BLOCK_MAX + 1];
280 enum chips chip_id;
281 int ret, i;
282 struct dentry *debugfs;
283 struct dentry *q54sj108a2_dir;
284 struct q54sj108a2_data *psu;
285
286 if (!i2c_check_functionality(client->adapter,
287 I2C_FUNC_SMBUS_BYTE_DATA |
288 I2C_FUNC_SMBUS_WORD_DATA |
289 I2C_FUNC_SMBUS_BLOCK_DATA))
290 return -ENODEV;
291
292 if (client->dev.of_node)
> 293 chip_id = (enum chips)of_device_get_match_data(dev);
294 else
295 chip_id = i2c_match_id(q54sj108a2_id, client)->driver_data;
296
297 ret = i2c_smbus_read_block_data(client, PMBUS_MFR_ID, buf);
298 if (ret < 0) {
299 dev_err(&client->dev, "Failed to read Manufacturer ID\n");
300 return ret;
301 }
302 if (ret != 5 || strncmp(buf, "DELTA", 5)) {
303 buf[ret] = '\0';
304 dev_err(dev, "Unsupported Manufacturer ID '%s'\n", buf);
305 return -ENODEV;
306 }
307
308 /*
309 * The chips support reading PMBUS_MFR_MODEL.
310 */
311 ret = i2c_smbus_read_block_data(client, PMBUS_MFR_MODEL, buf);
312 if (ret < 0) {
313 dev_err(dev, "Failed to read Manufacturer Model\n");
314 return ret;
315 }
316 if (ret != 14 || strncmp(buf, "Q54SJ108A2", 10)) {
317 buf[ret] = '\0';
318 dev_err(dev, "Unsupported Manufacturer Model '%s'\n", buf);
319 return -ENODEV;
320 }
321
322 ret = i2c_smbus_read_block_data(client, PMBUS_MFR_REVISION, buf);
323 if (ret < 0) {
324 dev_err(dev, "Failed to read Manufacturer Revision\n");
325 return ret;
326 }
327 if (ret != 4 || buf[0] != 'S') {
328 buf[ret] = '\0';
329 dev_err(dev, "Unsupported Manufacturer Revision '%s'\n", buf);
330 return -ENODEV;
331 }
332
333 ret = pmbus_do_probe(client, &q54sj108a2_id[chip_id], &q54sj108a2_info[chip_id]);
334 if (ret)
335 return ret;
336
337 psu = devm_kzalloc(&client->dev, sizeof(*psu), GFP_KERNEL);
338 if (!psu)
339 return 0;
340
341 psu->client = client;
342
343 debugfs = pmbus_get_debugfs_dir(client);
344
345 q54sj108a2_dir = debugfs_create_dir(client->name, debugfs);
346
347 for (i = 0; i < Q54SJ108A2_DEBUGFS_NUM_ENTRIES; ++i)
348 psu->debugfs_entries[i] = i;
349
350 debugfs_create_file("operation", 0644, q54sj108a2_dir,
351 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_OPERATION],
352 &q54sj108a2_fops);
353 debugfs_create_file("clear_fault", 0200, q54sj108a2_dir,
354 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_CLEARFAULT],
355 &q54sj108a2_fops);
356 debugfs_create_file("write_protect", 0444, q54sj108a2_dir,
357 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_WRITEPROTECT],
358 &q54sj108a2_fops);
359 debugfs_create_file("store_default", 0200, q54sj108a2_dir,
360 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_STOREDEFAULT],
361 &q54sj108a2_fops);
362 debugfs_create_file("vo_ov_response", 0644, q54sj108a2_dir,
363 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_VOOV_RESPONSE],
364 &q54sj108a2_fops);
365 debugfs_create_file("io_oc_response", 0644, q54sj108a2_dir,
366 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_IOOC_RESPONSE],
367 &q54sj108a2_fops);
368 debugfs_create_file("pmbus_revision", 0444, q54sj108a2_dir,
369 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_PMBUS_VERSION],
370 &q54sj108a2_fops);
371 debugfs_create_file("mfr_id", 0444, q54sj108a2_dir,
372 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_MFR_ID],
373 &q54sj108a2_fops);
374 debugfs_create_file("mfr_model", 0444, q54sj108a2_dir,
375 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_MFR_MODEL],
376 &q54sj108a2_fops);
377 debugfs_create_file("mfr_revision", 0444, q54sj108a2_dir,
378 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_MFR_REVISION],
379 &q54sj108a2_fops);
380 debugfs_create_file("mfr_location", 0444, q54sj108a2_dir,
381 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_MFR_LOCATION],
382 &q54sj108a2_fops);
383 debugfs_create_file("blackbox_erase", 0200, q54sj108a2_dir,
384 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_BLACKBOX_ERASE],
385 &q54sj108a2_fops);
386 debugfs_create_file("blackbox_read_offset", 0444, q54sj108a2_dir,
387 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_BLACKBOX_READ_OFFSET],
388 &q54sj108a2_fops);
389 debugfs_create_file("blackbox_set_offset", 0200, q54sj108a2_dir,
390 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_BLACKBOX_SET_OFFSET],
391 &q54sj108a2_fops);
392 debugfs_create_file("blackbox_read", 0444, q54sj108a2_dir,
393 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_BLACKBOX_READ],
394 &q54sj108a2_fops);
395 debugfs_create_file("flash_key", 0444, q54sj108a2_dir,
396 &psu->debugfs_entries[Q54SJ108A2_DEBUGFS_FLASH_KEY],
397 &q54sj108a2_fops);
398
399 return 0;
400 }
401

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2020-11-10 15:32    [W:0.056 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site