* [xilinx-xlnx:lkp_test 2/6] drivers/w1/masters/amd_w1.c:372:14: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations
@ 2023-10-06 1:39 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-10-06 1:39 UTC (permalink / raw)
To: Kris Chaplin; +Cc: llvm, oe-kbuild-all, git, Radhey Shyam Pandey
tree: https://github.com/Xilinx/linux-xlnx lkp_test
head: d81a4120bd209b0103e37eae6f5cceada1eda492
commit: 4e93fa1a4708500f0c532c44e9d35b34d223b59c [2/6] w1: Add 1-wire master driver for AMD programmable logic IP Core
config: powerpc-walnut_defconfig (https://download.01.org/0day-ci/archive/20231006/202310060909.mIWhFUj6-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231006/202310060909.mIWhFUj6-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310060909.mIWhFUj6-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:672:
arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
45 | DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46 | (p, b, c), pio, p)
| ~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET'
669 | __do_##name al; \
| ^~~~~~~~~~~~~~
<scratch space>:84:1: note: expanded from here
84 | __do_insw
| ^
arch/powerpc/include/asm/io.h:610:56: note: expanded from macro '__do_insw'
610 | #define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
| ~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/w1/masters/amd_w1.c:10:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
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:672:
arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
47 | DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48 | (p, b, c), pio, p)
| ~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET'
669 | __do_##name al; \
| ^~~~~~~~~~~~~~
<scratch space>:86:1: note: expanded from here
86 | __do_insl
| ^
arch/powerpc/include/asm/io.h:611:56: note: expanded from macro '__do_insl'
611 | #define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
| ~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/w1/masters/amd_w1.c:10:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
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:672:
arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
49 | DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50 | (p, b, c), pio, p)
| ~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET'
669 | __do_##name al; \
| ^~~~~~~~~~~~~~
<scratch space>:88:1: note: expanded from here
88 | __do_outsb
| ^
arch/powerpc/include/asm/io.h:612:58: note: expanded from macro '__do_outsb'
612 | #define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
| ~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/w1/masters/amd_w1.c:10:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
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:672:
arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
51 | DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52 | (p, b, c), pio, p)
| ~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET'
669 | __do_##name al; \
| ^~~~~~~~~~~~~~
<scratch space>:90:1: note: expanded from here
90 | __do_outsw
| ^
arch/powerpc/include/asm/io.h:613:58: note: expanded from macro '__do_outsw'
613 | #define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
| ~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/w1/masters/amd_w1.c:10:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
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:672:
arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
53 | DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
54 | (p, b, c), pio, p)
| ~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET'
669 | __do_##name al; \
| ^~~~~~~~~~~~~~
<scratch space>:92:1: note: expanded from here
92 | __do_outsl
| ^
arch/powerpc/include/asm/io.h:614:58: note: expanded from macro '__do_outsl'
614 | #define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
| ~~~~~~~~~~~~~~~~~~~~~^
>> drivers/w1/masters/amd_w1.c:372:14: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
372 | ver_major = FIELD_GET(AXIW1_MAJORVER_MASK, val);
| ^
6 warnings and 1 error generated.
vim +/FIELD_GET +372 drivers/w1/masters/amd_w1.c
319
320 static int amd_w1_probe(struct platform_device *pdev)
321 {
322 struct device *dev = &pdev->dev;
323 struct amd_w1_local *lp;
324 u32 ver_major, ver_minor;
325 int val, rc = 0;
326
327 /* Get iospace for the device */
328 lp = devm_kzalloc(dev, sizeof(*lp), GFP_KERNEL);
329 if (!lp)
330 return -ENOMEM;
331
332 lp->dev = dev;
333 lp->base_addr = devm_platform_ioremap_resource(pdev, 0);
334 if (IS_ERR(lp->base_addr))
335 return PTR_ERR(lp->base_addr);
336
337 /* Get IRQ for the device */
338 lp->irq = platform_get_irq(pdev, 0);
339 if (lp->irq <= 0)
340 return lp->irq;
341
342 rc = devm_request_irq(dev, lp->irq, &amd_w1_irq, IRQF_TRIGGER_HIGH, DRIVER_NAME, lp);
343 if (rc) {
344 dev_err(dev, "Could not allocate interrupt %d.\n", lp->irq);
345 return rc;
346 }
347
348 /* Initialize wait queue and flag */
349 init_waitqueue_head(&lp->wait_queue);
350
351 lp->clk = devm_clk_get_enabled(dev, NULL);
352 if (IS_ERR(lp->clk))
353 return PTR_ERR(lp->clk);
354
355 /* Verify IP presence in HW */
356 if (amd_w1_read_register(lp, AXIW1_IPID_REG) != AXIW1_IPID) {
357 dev_err(dev, "AMD 1-wire IP not detected in hardware\n");
358 return -ENODEV;
359 }
360
361 /*
362 * Allow for future driver expansion supporting new hardware features
363 * This driver currently only supports hardware 1.x, but include logic
364 * to detect if a potentially incompatible future version is used
365 * by reading major version ID. It is highly undesirable for new IP versions
366 * to break the API, but this code will at least allow for graceful failure
367 * should that happen. Future new features can be enabled by hardware
368 * incrementing the minor version and augmenting the driver to detect capability
369 * using the minor version number
370 */
371 val = amd_w1_read_register(lp, AXIW1_IPVER_REG);
> 372 ver_major = FIELD_GET(AXIW1_MAJORVER_MASK, val);
373 ver_minor = FIELD_GET(AXIW1_MINORVER_MASK, val);
374
375 if (ver_major != 1) {
376 dev_err(dev, "AMD AXI W1 Master version %u.%u is not supported by this driver",
377 ver_major, ver_minor);
378 return -ENODEV;
379 }
380
381 amd_w1_master.data = (void *)lp;
382 amd_w1_reset(lp);
383
384 platform_set_drvdata(pdev, lp);
385 rc = w1_add_master_device(&amd_w1_master);
386 if (rc) {
387 dev_err(dev, "Could not add master device\n");
388 amd_w1_reset(lp);
389 return rc;
390 }
391
392 return 0;
393 }
394
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-10-06 1:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-06 1:39 [xilinx-xlnx:lkp_test 2/6] drivers/w1/masters/amd_w1.c:372:14: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.