Re: [PATCH net-next v3 7/9] net: phy: icplus: fix paged register access
by kernel test robot
Hi Michael,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Michael-Walle/net-phy-icplus-cle...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git de1db4a6ed6241e34cab0e5059d4b56f6bae39b9
config: powerpc64-randconfig-r004-20210211 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
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 powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://github.com/0day-ci/linux/commit/07b7c444040f9baff7b28415b4f26be7e...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Michael-Walle/net-phy-icplus-cleanups-and-new-features/20210211-051702
git checkout 07b7c444040f9baff7b28415b4f26be7e7a71e2e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
__do_insb
^
arch/powerpc/include/asm/io.h:556:56: note: expanded from macro '__do_insb'
#define __do_insb(p, b, n) readsb((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/net/phy/icplus.c:11:
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:619:
arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:139:1: note: expanded from here
__do_insw
^
arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw'
#define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/net/phy/icplus.c:11:
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:619:
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:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:141:1: note: expanded from here
__do_insl
^
arch/powerpc/include/asm/io.h:558: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/net/phy/icplus.c:11:
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:619:
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:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:143:1: note: expanded from here
__do_outsb
^
arch/powerpc/include/asm/io.h:559: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/net/phy/icplus.c:11:
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:619:
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:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:145:1: note: expanded from here
__do_outsw
^
arch/powerpc/include/asm/io.h:560: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/net/phy/icplus.c:11:
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:619:
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:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:147:1: note: expanded from here
__do_outsl
^
arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl'
#define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
>> drivers/net/phy/icplus.c:237:2: warning: variable 'err' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
drivers/net/phy/icplus.c:249:43: note: uninitialized use occurs here
return phy_restore_page(phydev, oldpage, err);
^~~
drivers/net/phy/icplus.c:216:18: note: initialize the variable 'err' to silence this warning
int oldpage, err;
^
= 0
7 warnings generated.
vim +/err +237 drivers/net/phy/icplus.c
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 212
56ff94ca1f47d1 Michael Walle 2021-02-10 213 static int ip101a_g_config_intr_pin(struct phy_device *phydev)
034289b2d7cf29 Martin Blumenstingl 2018-11-18 214 {
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 215 struct ip101a_g_phy_priv *priv = phydev->priv;
07b7c444040f9b Michael Walle 2021-02-10 216 int oldpage, err;
07b7c444040f9b Michael Walle 2021-02-10 217
07b7c444040f9b Michael Walle 2021-02-10 218 oldpage = phy_select_page(phydev, IP101G_DEFAULT_PAGE);
034289b2d7cf29 Martin Blumenstingl 2018-11-18 219
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 220 /* configure the RXER/INTR_32 pin of the 32-pin IP101GR if needed: */
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 221 switch (priv->sel_intr32) {
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 222 case IP101GR_SEL_INTR32_RXER:
07b7c444040f9b Michael Walle 2021-02-10 223 err = __phy_modify(phydev, IP101G_DIGITAL_IO_SPEC_CTRL,
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 224 IP101G_DIGITAL_IO_SPEC_CTRL_SEL_INTR32, 0);
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 225 if (err < 0)
07b7c444040f9b Michael Walle 2021-02-10 226 goto out;
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 227 break;
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 228
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 229 case IP101GR_SEL_INTR32_INTR:
07b7c444040f9b Michael Walle 2021-02-10 230 err = __phy_modify(phydev, IP101G_DIGITAL_IO_SPEC_CTRL,
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 231 IP101G_DIGITAL_IO_SPEC_CTRL_SEL_INTR32,
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 232 IP101G_DIGITAL_IO_SPEC_CTRL_SEL_INTR32);
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 233 if (err < 0)
07b7c444040f9b Michael Walle 2021-02-10 234 goto out;
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 235 break;
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 236
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 @237 default:
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 238 /* Don't touch IP101G_DIGITAL_IO_SPEC_CTRL because it's not
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 239 * documented on IP101A and it's not clear whether this would
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 240 * cause problems.
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 241 * For the 32-pin IP101GR we simply keep the SEL_INTR32
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 242 * configuration as set by the bootloader when not configured
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 243 * to one of the special functions.
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 244 */
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 245 break;
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 246 }
f2f1a847e74f61 Martin Blumenstingl 2018-11-18 247
07b7c444040f9b Michael Walle 2021-02-10 248 out:
07b7c444040f9b Michael Walle 2021-02-10 249 return phy_restore_page(phydev, oldpage, err);
56ff94ca1f47d1 Michael Walle 2021-02-10 250 }
56ff94ca1f47d1 Michael Walle 2021-02-10 251
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
Re: [PATCH v2 net-next 3/4] net: phy: Add Qualcomm QCA807x driver
by kernel test robot
Hi Robert,
I love your patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Robert-Marko/Add-support-for-Qua...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git de1db4a6ed6241e34cab0e5059d4b56f6bae39b9
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
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
# https://github.com/0day-ci/linux/commit/bf3f094b38fe42c313ba63d67c21b64cf...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Robert-Marko/Add-support-for-Qualcomm-QCA807x-PHYs/20210210-210217
git checkout bf3f094b38fe42c313ba63d67c21b64cffb7f7b1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/net/phy/qca807x.c: In function 'qca807x_read_copper_status':
>> drivers/net/phy/qca807x.c:404:12: error: 'struct phy_device' has no member named 'port'
404 | if (phydev->port != PORT_TP)
| ^~
drivers/net/phy/qca807x.c:405:9: error: 'struct phy_device' has no member named 'port'
405 | phydev->port = PORT_TP;
| ^~
drivers/net/phy/qca807x.c: In function 'qca807x_read_fiber_status':
drivers/net/phy/qca807x.c:494:12: error: 'struct phy_device' has no member named 'port'
494 | if (phydev->port != PORT_FIBRE)
| ^~
drivers/net/phy/qca807x.c:495:9: error: 'struct phy_device' has no member named 'port'
495 | phydev->port = PORT_FIBRE;
| ^~
vim +404 drivers/net/phy/qca807x.c
399
400 static int qca807x_read_copper_status(struct phy_device *phydev, bool combo_port)
401 {
402 int ss, err, page, old_link = phydev->link;
403
> 404 if (phydev->port != PORT_TP)
405 phydev->port = PORT_TP;
406
407 /* Only combo port has dual pages */
408 if (combo_port) {
409 /* Check whether copper page is set and set if needed */
410 page = phy_read(phydev, QCA807X_CHIP_CONFIGURATION);
411 if (!(page & QCA807X_BT_BX_REG_SEL)) {
412 page |= QCA807X_BT_BX_REG_SEL;
413 phy_write(phydev, QCA807X_CHIP_CONFIGURATION, page);
414 }
415 }
416
417 /* Update the link, but return if there was an error */
418 err = genphy_update_link(phydev);
419 if (err)
420 return err;
421
422 /* why bother the PHY if nothing can have changed */
423 if (phydev->autoneg == AUTONEG_ENABLE && old_link && phydev->link)
424 return 0;
425
426 phydev->speed = SPEED_UNKNOWN;
427 phydev->duplex = DUPLEX_UNKNOWN;
428 phydev->pause = 0;
429 phydev->asym_pause = 0;
430
431 err = genphy_read_lpa(phydev);
432 if (err < 0)
433 return err;
434
435 /* Read the QCA807x PHY-Specific Status register copper page,
436 * which indicates the speed and duplex that the PHY is actually
437 * using, irrespective of whether we are in autoneg mode or not.
438 */
439 ss = phy_read(phydev, QCA807X_PHY_SPECIFIC_STATUS);
440 if (ss < 0)
441 return ss;
442
443 if (ss & QCA807X_SS_SPEED_AND_DUPLEX_RESOLVED) {
444 int sfc;
445
446 sfc = phy_read(phydev, QCA807X_FUNCTION_CONTROL);
447 if (sfc < 0)
448 return sfc;
449
450 switch (FIELD_GET(QCA807X_SS_SPEED_MASK, ss)) {
451 case QCA807X_SS_SPEED_10:
452 phydev->speed = SPEED_10;
453 break;
454 case QCA807X_SS_SPEED_100:
455 phydev->speed = SPEED_100;
456 break;
457 case QCA807X_SS_SPEED_1000:
458 phydev->speed = SPEED_1000;
459 break;
460 }
461 if (ss & QCA807X_SS_DUPLEX)
462 phydev->duplex = DUPLEX_FULL;
463 else
464 phydev->duplex = DUPLEX_HALF;
465
466 if (ss & QCA807X_SS_MDIX)
467 phydev->mdix = ETH_TP_MDI_X;
468 else
469 phydev->mdix = ETH_TP_MDI;
470
471 switch (FIELD_GET(QCA807X_FC_MDI_CROSSOVER_MODE_MASK, sfc)) {
472 case QCA807X_FC_MDI_CROSSOVER_MANUAL_MDI:
473 phydev->mdix_ctrl = ETH_TP_MDI;
474 break;
475 case QCA807X_FC_MDI_CROSSOVER_MANUAL_MDIX:
476 phydev->mdix_ctrl = ETH_TP_MDI_X;
477 break;
478 case QCA807X_FC_MDI_CROSSOVER_AUTO:
479 phydev->mdix_ctrl = ETH_TP_MDI_AUTO;
480 break;
481 }
482 }
483
484 if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete)
485 phy_resolve_aneg_pause(phydev);
486
487 return 0;
488 }
489
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[scsi:misc 187/196] drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4327:35: sparse: sparse: incorrect type in argument 4 (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git misc
head: d2aacd36a8e00bc1813841b482e3933acb1ea0b5
commit: cd96fe600cc4924d8d0cc6e3161870219c0d2c12 [187/196] scsi: hisi_sas: Add trace FIFO debugfs support
config: i386-randconfig-s002-20210211 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-215-g0fb77bb6-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git/commit/?id=...
git remote add scsi https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
git fetch --no-tags scsi misc
git checkout cd96fe600cc4924d8d0cc6e3161870219c0d2c12
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4327:35: sparse: sparse: incorrect type in argument 4 (different base types) @@ expected restricted __le32 [usertype] *[assigned] ptr @@ got unsigned int * @@
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4327:35: sparse: expected restricted __le32 [usertype] *[assigned] ptr
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4327:35: sparse: got unsigned int *
vim +4327 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
4319
4320 static int debugfs_fifo_data_v3_hw_show(struct seq_file *s, void *p)
4321 {
4322 struct hisi_sas_phy *phy = s->private;
4323
4324 debugfs_read_fifo_data_v3_hw(phy);
4325
4326 debugfs_show_row_32_v3_hw(s, 0, HISI_SAS_FIFO_DATA_DW_SIZE * 4,
> 4327 phy->fifo.rd_data);
4328
4329 return 0;
4330 }
4331 DEFINE_SHOW_ATTRIBUTE(debugfs_fifo_data_v3_hw);
4332
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[linux-platform-drivers-x86:review-hans 10/93] drivers/platform/surface/aggregator/ssh_packet_layer.c:1413:44: sparse: sparse: restricted __le16 degrades to integer
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x8... review-hans
head: 0f1f7f22f384f34b2f0800a3734aa0fc83eafff2
commit: c167b9c7e3d6131b4a4865c112a3dbc86d2e997d [10/93] platform/surface: Add Surface Aggregator subsystem
config: i386-randconfig-s002-20210211 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-215-g0fb77bb6-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x8...
git remote add linux-platform-drivers-x86 https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x8...
git fetch --no-tags linux-platform-drivers-x86 review-hans
git checkout c167b9c7e3d6131b4a4865c112a3dbc86d2e997d
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> drivers/platform/surface/aggregator/ssh_packet_layer.c:1413:44: sparse: sparse: restricted __le16 degrades to integer
vim +1413 drivers/platform/surface/aggregator/ssh_packet_layer.c
1343
1344 static size_t ssh_ptl_rx_eval(struct ssh_ptl *ptl, struct ssam_span *source)
1345 {
1346 struct ssh_frame *frame;
1347 struct ssam_span payload;
1348 struct ssam_span aligned;
1349 bool syn_found;
1350 int status;
1351
1352 /* Find SYN. */
1353 syn_found = sshp_find_syn(source, &aligned);
1354
1355 if (unlikely(aligned.ptr - source->ptr) > 0) {
1356 ptl_warn(ptl, "rx: parser: invalid start of frame, skipping\n");
1357
1358 /*
1359 * Notes:
1360 * - This might send multiple NAKs in case the communication
1361 * starts with an invalid SYN and is broken down into multiple
1362 * pieces. This should generally be handled fine, we just
1363 * might receive duplicate data in this case, which is
1364 * detected when handling data frames.
1365 * - This path will also be executed on invalid CRCs: When an
1366 * invalid CRC is encountered, the code below will skip data
1367 * until directly after the SYN. This causes the search for
1368 * the next SYN, which is generally not placed directly after
1369 * the last one.
1370 *
1371 * Open question: Should we send this in case of invalid
1372 * payload CRCs if the frame-type is non-sequential (current
1373 * implementation) or should we drop that frame without
1374 * telling the EC?
1375 */
1376 ssh_ptl_send_nak(ptl);
1377 }
1378
1379 if (unlikely(!syn_found))
1380 return aligned.ptr - source->ptr;
1381
1382 /* Parse and validate frame. */
1383 status = sshp_parse_frame(&ptl->serdev->dev, &aligned, &frame, &payload,
1384 SSH_PTL_RX_BUF_LEN);
1385 if (status) /* Invalid frame: skip to next SYN. */
1386 return aligned.ptr - source->ptr + sizeof(u16);
1387 if (!frame) /* Not enough data. */
1388 return aligned.ptr - source->ptr;
1389
1390 switch (frame->type) {
1391 case SSH_FRAME_TYPE_ACK:
1392 ssh_ptl_acknowledge(ptl, frame->seq);
1393 break;
1394
1395 case SSH_FRAME_TYPE_NAK:
1396 ssh_ptl_resubmit_pending(ptl);
1397 break;
1398
1399 case SSH_FRAME_TYPE_DATA_SEQ:
1400 ssh_ptl_send_ack(ptl, frame->seq);
1401 fallthrough;
1402
1403 case SSH_FRAME_TYPE_DATA_NSQ:
1404 ssh_ptl_rx_dataframe(ptl, frame, &payload);
1405 break;
1406
1407 default:
1408 ptl_warn(ptl, "ptl: received frame with unknown type %#04x\n",
1409 frame->type);
1410 break;
1411 }
1412
> 1413 return aligned.ptr - source->ptr + SSH_MESSAGE_LENGTH(frame->len);
1414 }
1415
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[soc:broadcom/drivers 2/4] drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:45: sparse: sparse: cast to restricted __le32
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git broadcom/drivers
head: 8b8f095b9076ca61107c0910c9273afd1dfa1f04
commit: 8bcac4011ebe0dbdd46fd55b036ee855c95702d3 [2/4] soc: bcm: add PM driver for Broadcom's PMB
config: i386-randconfig-s002-20210211 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-215-g0fb77bb6-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/commit/?id=8b...
git remote add soc https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git
git fetch --no-tags soc broadcom/drivers
git checkout 8bcac4011ebe0dbdd46fd55b036ee855c95702d3
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:65: sparse: sparse: cast to restricted __be32
drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:65: sparse: sparse: cast to restricted __be32
drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:65: sparse: sparse: cast to restricted __be32
drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:65: sparse: sparse: cast to restricted __be32
drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:65: sparse: sparse: cast to restricted __be32
drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:65: sparse: sparse: cast to restricted __be32
>> drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:45: sparse: sparse: cast to restricted __le32
>> drivers/soc/bcm/bcm63xx/bcm-pmb.c:115:36: sparse: sparse: restricted __le32 degrades to integer
drivers/soc/bcm/bcm63xx/bcm-pmb.c:115:55: sparse: sparse: restricted __be32 degrades to integer
vim +103 drivers/soc/bcm/bcm63xx/bcm-pmb.c
90
91 static int bcm_pmb_bpcm_read(struct bcm_pmb *pmb, int bus, u8 device,
92 int offset, u32 *val)
93 {
94 void __iomem *base = pmb->base + bus * 0x20;
95 unsigned long flags;
96 int err;
97
98 spin_lock_irqsave(&pmb->lock, flags);
99 err = bpcm_rd(base, device, offset, val);
100 spin_unlock_irqrestore(&pmb->lock, flags);
101
102 if (!err)
> 103 *val = pmb->little_endian ? le32_to_cpu(*val) : be32_to_cpu(*val);
104
105 return err;
106 }
107
108 static int bcm_pmb_bpcm_write(struct bcm_pmb *pmb, int bus, u8 device,
109 int offset, u32 val)
110 {
111 void __iomem *base = pmb->base + bus * 0x20;
112 unsigned long flags;
113 int err;
114
> 115 val = pmb->little_endian ? cpu_to_le32(val) : cpu_to_be32(val);
116
117 spin_lock_irqsave(&pmb->lock, flags);
118 err = bpcm_wr(base, device, offset, val);
119 spin_unlock_irqrestore(&pmb->lock, flags);
120
121 return err;
122 }
123
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
Re: [PATCH][next] net: hns3: Fix uninitialized return from function
by kernel test robot
Hi Colin,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.11-rc7 next-20210125]
[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/Colin-King/net-hns3-Fix-uninitia...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e0756cfc7d7cd08c98a53b6009c091a3f6a50be6
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
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
# https://github.com/0day-ci/linux/commit/e51cd2716c8b5c2ba8daf480c7852c6b2...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Colin-King/net-hns3-Fix-uninitialized-return-from-function/20210210-233553
git checkout e51cd2716c8b5c2ba8daf480c7852c6b2feaac82
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c: In function 'hns3_reset_notify_uninit_enet':
>> drivers/net/ethernet/hisilicon/hns3/hns3_enet.c:4684:2: error: 'ret' undeclared (first use in this function); did you mean 'net'?
4684 | ret = hns3_uninit_all_ring(priv);
| ^~~
| net
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c:4684:2: note: each undeclared identifier is reported only once for each function it appears in
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for FRAME_POINTER
Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
Selected by
- FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86
vim +4684 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
bb6b94a896d4dd drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c Lipeng 2017-11-02 4662
bb6b94a896d4dd drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c Lipeng 2017-11-02 4663 static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle)
bb6b94a896d4dd drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c Lipeng 2017-11-02 4664 {
bb6b94a896d4dd drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c Lipeng 2017-11-02 4665 struct net_device *netdev = handle->kinfo.netdev;
bb6b94a896d4dd drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c Lipeng 2017-11-02 4666 struct hns3_nic_priv *priv = netdev_priv(netdev);
bb6b94a896d4dd drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c Lipeng 2017-11-02 4667
1eeb3367897a3f drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Huazhong Tan 2019-04-04 4668 if (!test_and_clear_bit(HNS3_NIC_STATE_INITED, &priv->state)) {
814da63c557726 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Huazhong Tan 2018-11-07 4669 netdev_warn(netdev, "already uninitialized\n");
814da63c557726 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Huazhong Tan 2018-11-07 4670 return 0;
814da63c557726 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Huazhong Tan 2018-11-07 4671 }
814da63c557726 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Huazhong Tan 2018-11-07 4672
08a100689d4baf drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Yonglong Liu 2020-01-04 4673 hns3_free_rx_cpu_rmap(netdev);
08a100689d4baf drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Yonglong Liu 2020-01-04 4674 hns3_nic_uninit_irq(priv);
f96315f2f17e7b drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Huazhong Tan 2019-06-28 4675 hns3_clear_all_ring(handle, true);
f96315f2f17e7b drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Huazhong Tan 2019-06-28 4676 hns3_reset_tx_queue(priv->ae_handle);
bb6b94a896d4dd drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c Lipeng 2017-11-02 4677
e215278548f9ea drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Huazhong Tan 2019-01-31 4678 hns3_nic_uninit_vector_data(priv);
bb6b94a896d4dd drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c Lipeng 2017-11-02 4679
e4fd75022c24eb drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Huazhong Tan 2018-09-26 4680 hns3_store_coal(priv);
e4fd75022c24eb drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Huazhong Tan 2018-09-26 4681
08a100689d4baf drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Yonglong Liu 2020-01-04 4682 hns3_nic_dealloc_vector_data(priv);
862d969a3a4dcd drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Huazhong Tan 2018-11-09 4683
bb6b94a896d4dd drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c Lipeng 2017-11-02 @4684 ret = hns3_uninit_all_ring(priv);
bb6b94a896d4dd drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c Lipeng 2017-11-02 4685 if (ret)
bb6b94a896d4dd drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c Lipeng 2017-11-02 4686 netdev_err(netdev, "uninit ring error\n");
bb6b94a896d4dd drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c Lipeng 2017-11-02 4687
2c9dd668914bb9 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Huazhong Tan 2019-01-18 4688 hns3_put_ring_config(priv);
2c9dd668914bb9 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Huazhong Tan 2019-01-18 4689
e51cd2716c8b5c drivers/net/ethernet/hisilicon/hns3/hns3_enet.c Colin Ian King 2021-02-10 4690 return 0;
bb6b94a896d4dd drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c Lipeng 2017-11-02 4691 }
bb6b94a896d4dd drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c Lipeng 2017-11-02 4692
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
drivers/accessibility/speakup/speakup_acntpc.c:262:14: warning: performing pointer arithmetic on a null pointer has undefined behavior
by kernel test robot
Hi Samuel,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e0756cfc7d7cd08c98a53b6009c091a3f6a50be6
commit: 2067fd92d75b6d9085a43caf050bca5d88c491b8 staging/speakup: Move out of staging
date: 7 months ago
config: riscv-randconfig-r006-20210211 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 2067fd92d75b6d9085a43caf050bca5d88c491b8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from drivers/accessibility/speakup/speakup_acntpc.c:19:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:556:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inb(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:54:76: note: expanded from macro 'inb'
#define inb(c) ({ u8 __v; __io_pbr(); __v = readb_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:93:48: note: expanded from macro 'readb_cpu'
#define readb_cpu(c) ({ u8 __r = __raw_readb(c); __r; })
^
In file included from drivers/accessibility/speakup/speakup_acntpc.c:19:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:564:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inw(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:55:76: note: expanded from macro 'inw'
#define inw(c) ({ u16 __v; __io_pbr(); __v = readw_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:94:76: note: expanded from macro 'readw_cpu'
#define readw_cpu(c) ({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from drivers/accessibility/speakup/speakup_acntpc.c:19:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:572:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inl(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:56:76: note: expanded from macro 'inl'
#define inl(c) ({ u32 __v; __io_pbr(); __v = readl_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:95:76: note: expanded from macro 'readl_cpu'
#define readl_cpu(c) ({ u32 __r = le32_to_cpu((__force __le32)__raw_readl(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from drivers/accessibility/speakup/speakup_acntpc.c:19:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:580:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outb(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:58:68: note: expanded from macro 'outb'
#define outb(v,c) ({ __io_pbw(); writeb_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:97:52: note: expanded from macro 'writeb_cpu'
#define writeb_cpu(v, c) ((void)__raw_writeb((v), (c)))
^
In file included from drivers/accessibility/speakup/speakup_acntpc.c:19:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:588:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outw(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:59:68: note: expanded from macro 'outw'
#define outw(v,c) ({ __io_pbw(); writew_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:98:76: note: expanded from macro 'writew_cpu'
#define writew_cpu(v, c) ((void)__raw_writew((__force u16)cpu_to_le16(v), (c)))
^
In file included from drivers/accessibility/speakup/speakup_acntpc.c:19:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:596:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outl(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:60:68: note: expanded from macro 'outl'
#define outl(v,c) ({ __io_pbw(); writel_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:99:76: note: expanded from macro 'writel_cpu'
#define writel_cpu(v, c) ((void)__raw_writel((__force u32)cpu_to_le32(v), (c)))
^
In file included from drivers/accessibility/speakup/speakup_acntpc.c:19:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:1017:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
>> drivers/accessibility/speakup/speakup_acntpc.c:262:14: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
port_val = inw(speakup_info.port_tts - 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:55:76: note: expanded from macro 'inw'
#define inw(c) ({ u16 __v; __io_pbr(); __v = readw_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:94:76: note: expanded from macro 'readw_cpu'
#define readw_cpu(c) ({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
drivers/accessibility/speakup/speakup_acntpc.c:273:15: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
port_val = inw(synth_portlist[i]) & 0xfffc;
^~~~~~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:55:76: note: expanded from macro 'inw'
#define inw(c) ({ u16 __v; __io_pbr(); __v = readw_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:94:76: note: expanded from macro 'readw_cpu'
#define readw_cpu(c) ({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
9 warnings generated.
--
In file included from drivers/accessibility/speakup/speakup_dtlk.c:18:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:556:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inb(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:54:76: note: expanded from macro 'inb'
#define inb(c) ({ u8 __v; __io_pbr(); __v = readb_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:93:48: note: expanded from macro 'readb_cpu'
#define readb_cpu(c) ({ u8 __r = __raw_readb(c); __r; })
^
In file included from drivers/accessibility/speakup/speakup_dtlk.c:18:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:564:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inw(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:55:76: note: expanded from macro 'inw'
#define inw(c) ({ u16 __v; __io_pbr(); __v = readw_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:94:76: note: expanded from macro 'readw_cpu'
#define readw_cpu(c) ({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from drivers/accessibility/speakup/speakup_dtlk.c:18:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:572:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inl(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:56:76: note: expanded from macro 'inl'
#define inl(c) ({ u32 __v; __io_pbr(); __v = readl_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:95:76: note: expanded from macro 'readl_cpu'
#define readl_cpu(c) ({ u32 __r = le32_to_cpu((__force __le32)__raw_readl(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from drivers/accessibility/speakup/speakup_dtlk.c:18:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:580:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outb(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:58:68: note: expanded from macro 'outb'
#define outb(v,c) ({ __io_pbw(); writeb_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:97:52: note: expanded from macro 'writeb_cpu'
#define writeb_cpu(v, c) ((void)__raw_writeb((v), (c)))
^
In file included from drivers/accessibility/speakup/speakup_dtlk.c:18:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:588:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outw(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:59:68: note: expanded from macro 'outw'
#define outw(v,c) ({ __io_pbw(); writew_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:98:76: note: expanded from macro 'writew_cpu'
#define writew_cpu(v, c) ((void)__raw_writew((__force u16)cpu_to_le16(v), (c)))
^
In file included from drivers/accessibility/speakup/speakup_dtlk.c:18:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:596:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outl(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:60:68: note: expanded from macro 'outl'
#define outl(v,c) ({ __io_pbw(); writel_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:99:76: note: expanded from macro 'writel_cpu'
#define writel_cpu(v, c) ((void)__raw_writel((__force u32)cpu_to_le32(v), (c)))
^
In file included from drivers/accessibility/speakup/speakup_dtlk.c:18:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:1017:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
>> drivers/accessibility/speakup/speakup_dtlk.c:334:14: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
port_val = inw(speakup_info.port_tts - 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:55:76: note: expanded from macro 'inw'
#define inw(c) ({ u16 __v; __io_pbr(); __v = readw_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:94:76: note: expanded from macro 'readw_cpu'
#define readw_cpu(c) ({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
drivers/accessibility/speakup/speakup_dtlk.c:341:15: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
port_val = inw(synth_portlist[i]) & 0xfbff;
^~~~~~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:55:76: note: expanded from macro 'inw'
#define inw(c) ({ u16 __v; __io_pbr(); __v = readw_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:94:76: note: expanded from macro 'readw_cpu'
#define readw_cpu(c) ({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
9 warnings generated.
--
In file included from drivers/accessibility/speakup/speakup_keypc.c:17:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:556:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inb(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:54:76: note: expanded from macro 'inb'
#define inb(c) ({ u8 __v; __io_pbr(); __v = readb_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:93:48: note: expanded from macro 'readb_cpu'
#define readb_cpu(c) ({ u8 __r = __raw_readb(c); __r; })
^
In file included from drivers/accessibility/speakup/speakup_keypc.c:17:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:564:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inw(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:55:76: note: expanded from macro 'inw'
#define inw(c) ({ u16 __v; __io_pbr(); __v = readw_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:94:76: note: expanded from macro 'readw_cpu'
#define readw_cpu(c) ({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from drivers/accessibility/speakup/speakup_keypc.c:17:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:572:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inl(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:56:76: note: expanded from macro 'inl'
#define inl(c) ({ u32 __v; __io_pbr(); __v = readl_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:95:76: note: expanded from macro 'readl_cpu'
#define readl_cpu(c) ({ u32 __r = le32_to_cpu((__force __le32)__raw_readl(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from drivers/accessibility/speakup/speakup_keypc.c:17:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:580:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outb(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:58:68: note: expanded from macro 'outb'
#define outb(v,c) ({ __io_pbw(); writeb_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:97:52: note: expanded from macro 'writeb_cpu'
#define writeb_cpu(v, c) ((void)__raw_writeb((v), (c)))
^
In file included from drivers/accessibility/speakup/speakup_keypc.c:17:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:588:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outw(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:59:68: note: expanded from macro 'outw'
#define outw(v,c) ({ __io_pbw(); writew_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:98:76: note: expanded from macro 'writew_cpu'
#define writew_cpu(v, c) ((void)__raw_writew((__force u16)cpu_to_le16(v), (c)))
^
In file included from drivers/accessibility/speakup/speakup_keypc.c:17:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:596:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outl(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:60:68: note: expanded from macro 'outl'
#define outl(v,c) ({ __io_pbw(); writel_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:99:76: note: expanded from macro 'writel_cpu'
#define writel_cpu(v, c) ((void)__raw_writel((__force u32)cpu_to_le32(v), (c)))
^
In file included from drivers/accessibility/speakup/speakup_keypc.c:17:
In file included from drivers/accessibility/speakup/spk_priv.h:16:
In file included from drivers/accessibility/speakup/spk_types.h:17:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:1017:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
>> drivers/accessibility/speakup/speakup_keypc.c:268:14: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
port_val = inb(synth_port);
^~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:54:76: note: expanded from macro 'inb'
#define inb(c) ({ u8 __v; __io_pbr(); __v = readb_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:93:48: note: expanded from macro 'readb_cpu'
#define readb_cpu(c) ({ u8 __r = __raw_readb(c); __r; })
^
drivers/accessibility/speakup/speakup_keypc.c:278:15: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
port_val = inb(synth_portlist[i]);
^~~~~~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:54:76: note: expanded from macro 'inb'
#define inb(c) ({ u8 __v; __io_pbr(); __v = readb_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:93:48: note: expanded from macro 'readb_cpu'
#define readb_cpu(c) ({ u8 __r = __raw_readb(c); __r; })
^
9 warnings generated.
..
vim +262 drivers/accessibility/speakup/speakup_acntpc.c
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 246
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 247 static int synth_probe(struct spk_synth *synth)
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 248 {
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 249 unsigned int port_val = 0;
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 250 int i = 0;
8e69a811068657 drivers/staging/speakup/speakup_acntpc.c Domagoj Trsan 2014-09-09 251
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 252 pr_info("Probing for %s.\n", synth->long_name);
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 253 if (port_forced) {
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 254 speakup_info.port_tts = port_forced;
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 255 pr_info("probe forced to %x by kernel command line\n",
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 256 speakup_info.port_tts);
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 257 if (synth_request_region(speakup_info.port_tts - 1,
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 258 SYNTH_IO_EXTENT)) {
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 259 pr_warn("sorry, port already reserved\n");
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 260 return -EBUSY;
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 261 }
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 @262 port_val = inw(speakup_info.port_tts - 1);
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 263 synth_port_control = speakup_info.port_tts - 1;
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 264 } else {
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 265 for (i = 0; synth_portlist[i]; i++) {
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 266 if (synth_request_region(synth_portlist[i],
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 267 SYNTH_IO_EXTENT)) {
bf4a4bacb051c2 drivers/staging/speakup/speakup_acntpc.c Christopher Brannon 2010-10-14 268 pr_warn
bf4a4bacb051c2 drivers/staging/speakup/speakup_acntpc.c Christopher Brannon 2010-10-14 269 ("request_region: failed with 0x%x, %d\n",
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 270 synth_portlist[i], SYNTH_IO_EXTENT);
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 271 continue;
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 272 }
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 273 port_val = inw(synth_portlist[i]) & 0xfffc;
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 274 if (port_val == 0x53fc) {
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 275 /* 'S' and out&input bits */
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 276 synth_port_control = synth_portlist[i];
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 277 speakup_info.port_tts = synth_port_control + 1;
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 278 break;
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 279 }
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 280 }
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 281 }
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 282 port_val &= 0xfffc;
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 283 if (port_val != 0x53fc) {
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 284 /* 'S' and out&input bits */
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 285 pr_info("%s: not found\n", synth->long_name);
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 286 synth_release_region(synth_port_control, SYNTH_IO_EXTENT);
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 287 synth_port_control = 0;
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 288 return -ENODEV;
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 289 }
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 290 pr_info("%s: %03x-%03x, driver version %s,\n", synth->long_name,
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 291 synth_port_control, synth_port_control + SYNTH_IO_EXTENT - 1,
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 292 synth->version);
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 293 synth->alive = 1;
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 294 return 0;
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 295 }
c6e3fd22cd5383 drivers/staging/speakup/speakup_acntpc.c William Hubbs 2010-10-07 296
:::::: The code at line 262 was first introduced by commit
:::::: c6e3fd22cd538365bfeb82997d5b89562e077d42 Staging: add speakup to the staging directory
:::::: TO: William Hubbs <w.d.hubbs(a)gmail.com>
:::::: CC: Greg Kroah-Hartman <gregkh(a)suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
Re: [PATCH] dma-buf: system_heap: do not warn for costly allocation
by kernel test robot
Hi Minchan,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.11-rc7 next-20210125]
[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/Minchan-Kim/dma-buf-system_heap-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e0756cfc7d7cd08c98a53b6009c091a3f6a50be6
config: i386-randconfig-s002-20210209 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-215-g0fb77bb6-dirty
# https://github.com/0day-ci/linux/commit/28176611ddc50d5d84aa71679f32b0b22...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Minchan-Kim/dma-buf-system_heap-do-not-warn-for-costly-allocation/20210211-003048
git checkout 28176611ddc50d5d84aa71679f32b0b22dbf4b1c
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> drivers/dma-buf/heaps/system_heap.c:327:27: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long gfp_flags @@ got restricted gfp_t @@
drivers/dma-buf/heaps/system_heap.c:327:27: sparse: expected unsigned long gfp_flags
drivers/dma-buf/heaps/system_heap.c:327:27: sparse: got restricted gfp_t
>> drivers/dma-buf/heaps/system_heap.c:329:35: sparse: sparse: invalid assignment: |=
>> drivers/dma-buf/heaps/system_heap.c:329:35: sparse: left side has type unsigned long
>> drivers/dma-buf/heaps/system_heap.c:329:35: sparse: right side has type restricted gfp_t
>> drivers/dma-buf/heaps/system_heap.c:331:36: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted gfp_t [usertype] gfp_mask @@ got unsigned long gfp_flags @@
drivers/dma-buf/heaps/system_heap.c:331:36: sparse: expected restricted gfp_t [usertype] gfp_mask
drivers/dma-buf/heaps/system_heap.c:331:36: sparse: got unsigned long gfp_flags
vim +327 drivers/dma-buf/heaps/system_heap.c
313
314 static struct page *alloc_largest_available(unsigned long size,
315 unsigned int max_order)
316 {
317 struct page *page;
318 unsigned long gfp_flags;
319 int i;
320
321 for (i = 0; i < NUM_ORDERS; i++) {
322 if (size < (PAGE_SIZE << orders[i]))
323 continue;
324 if (max_order < orders[i])
325 continue;
326
> 327 gfp_flags = order_flags[i];
328 if (orders[i] > PAGE_ALLOC_COSTLY_ORDER)
> 329 gfp_flags |= __GFP_NOWARN;
330
> 331 page = alloc_pages(gfp_flags, orders[i]);
332 if (!page)
333 continue;
334 return page;
335 }
336 return NULL;
337 }
338
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months