[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202111202237.VTwujn3i-lkp@intel.com>
Date: Sat, 20 Nov 2021 22:54:44 +0800
From: kernel test robot <lkp@...el.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: kbuild-all@...ts.01.org, netdev@...r.kernel.org
Subject: [net-next:master 351/356]
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c:596:61: warning: passing
argument 2 of 'octeon_mgmt_cam_state_add' discards 'const' qualifier from
pointer target type
tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head: 979594c5ff7b82e4787c8491680a2658bd88b780
commit: adeef3e32146a8d2a73c399dc6f5d76a449131b1 [351/356] net: constify netdev->dev_addr
config: mips-cavium_octeon_defconfig (attached as .config)
compiler: mips64-linux-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?id=adeef3e32146a8d2a73c399dc6f5d76a449131b1
git remote add net-next https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
git fetch --no-tags net-next master
git checkout adeef3e32146a8d2a73c399dc6f5d76a449131b1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c: In function 'octeon_mgmt_set_rx_filtering':
>> drivers/net/ethernet/cavium/octeon/octeon_mgmt.c:596:61: warning: passing argument 2 of 'octeon_mgmt_cam_state_add' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
596 | octeon_mgmt_cam_state_add(&cam_state, netdev->dev_addr);
| ~~~~~~^~~~~~~~~~
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c:551:54: note: expected 'unsigned char *' but argument is of type 'const unsigned char *'
551 | unsigned char *addr)
| ~~~~~~~~~~~~~~~^~~~
vim +596 drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 560
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 561 static void octeon_mgmt_set_rx_filtering(struct net_device *netdev)
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 562 {
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 563 struct octeon_mgmt *p = netdev_priv(netdev);
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 564 union cvmx_agl_gmx_rxx_adr_ctl adr_ctl;
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 565 union cvmx_agl_gmx_prtx_cfg agl_gmx_prtx;
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 566 unsigned long flags;
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 567 unsigned int prev_packet_enable;
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 568 unsigned int cam_mode = 1; /* 1 - Accept on CAM match */
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 569 unsigned int multicast_mode = 1; /* 1 - Reject all multicast. */
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 570 struct octeon_mgmt_cam_state cam_state;
22bedad3ce112d drivers/net/octeon/octeon_mgmt.c Jiri Pirko 2010-04-01 571 struct netdev_hw_addr *ha;
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 572 int available_cam_entries;
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 573
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 574 memset(&cam_state, 0, sizeof(cam_state));
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 575
62538d2490d071 drivers/net/octeon/octeon_mgmt.c David Daney 2010-05-05 576 if ((netdev->flags & IFF_PROMISC) || netdev->uc.count > 7) {
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 577 cam_mode = 0;
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 578 available_cam_entries = 8;
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 579 } else {
a0ce9b1e899494 drivers/net/ethernet/octeon/octeon_mgmt.c David Daney 2012-08-21 580 /* One CAM entry for the primary address, leaves seven
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 581 * for the secondary addresses.
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 582 */
62538d2490d071 drivers/net/octeon/octeon_mgmt.c David Daney 2010-05-05 583 available_cam_entries = 7 - netdev->uc.count;
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 584 }
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 585
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 586 if (netdev->flags & IFF_MULTICAST) {
4cd24eaf0c6ee7 drivers/net/octeon/octeon_mgmt.c Jiri Pirko 2010-02-08 587 if (cam_mode == 0 || (netdev->flags & IFF_ALLMULTI) ||
4cd24eaf0c6ee7 drivers/net/octeon/octeon_mgmt.c Jiri Pirko 2010-02-08 588 netdev_mc_count(netdev) > available_cam_entries)
62538d2490d071 drivers/net/octeon/octeon_mgmt.c David Daney 2010-05-05 589 multicast_mode = 2; /* 2 - Accept all multicast. */
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 590 else
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 591 multicast_mode = 0; /* 0 - Use CAM. */
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 592 }
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 593
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 594 if (cam_mode == 1) {
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 595 /* Add primary address. */
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 @596 octeon_mgmt_cam_state_add(&cam_state, netdev->dev_addr);
62538d2490d071 drivers/net/octeon/octeon_mgmt.c David Daney 2010-05-05 597 netdev_for_each_uc_addr(ha, netdev)
62538d2490d071 drivers/net/octeon/octeon_mgmt.c David Daney 2010-05-05 598 octeon_mgmt_cam_state_add(&cam_state, ha->addr);
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 599 }
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 600 if (multicast_mode == 0) {
22bedad3ce112d drivers/net/octeon/octeon_mgmt.c Jiri Pirko 2010-04-01 601 netdev_for_each_mc_addr(ha, netdev)
22bedad3ce112d drivers/net/octeon/octeon_mgmt.c Jiri Pirko 2010-04-01 602 octeon_mgmt_cam_state_add(&cam_state, ha->addr);
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 603 }
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 604
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 605 spin_lock_irqsave(&p->lock, flags);
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 606
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 607 /* Disable packet I/O. */
368bec0d4a84f7 drivers/net/ethernet/octeon/octeon_mgmt.c David Daney 2012-07-05 608 agl_gmx_prtx.u64 = cvmx_read_csr(p->agl + AGL_GMX_PRT_CFG);
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 609 prev_packet_enable = agl_gmx_prtx.s.en;
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 610 agl_gmx_prtx.s.en = 0;
368bec0d4a84f7 drivers/net/ethernet/octeon/octeon_mgmt.c David Daney 2012-07-05 611 cvmx_write_csr(p->agl + AGL_GMX_PRT_CFG, agl_gmx_prtx.u64);
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 612
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 613 adr_ctl.u64 = 0;
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 614 adr_ctl.s.cam_mode = cam_mode;
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 615 adr_ctl.s.mcst = multicast_mode;
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 616 adr_ctl.s.bcst = 1; /* Allow broadcast */
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 617
368bec0d4a84f7 drivers/net/ethernet/octeon/octeon_mgmt.c David Daney 2012-07-05 618 cvmx_write_csr(p->agl + AGL_GMX_RX_ADR_CTL, adr_ctl.u64);
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 619
368bec0d4a84f7 drivers/net/ethernet/octeon/octeon_mgmt.c David Daney 2012-07-05 620 cvmx_write_csr(p->agl + AGL_GMX_RX_ADR_CAM0, cam_state.cam[0]);
368bec0d4a84f7 drivers/net/ethernet/octeon/octeon_mgmt.c David Daney 2012-07-05 621 cvmx_write_csr(p->agl + AGL_GMX_RX_ADR_CAM1, cam_state.cam[1]);
368bec0d4a84f7 drivers/net/ethernet/octeon/octeon_mgmt.c David Daney 2012-07-05 622 cvmx_write_csr(p->agl + AGL_GMX_RX_ADR_CAM2, cam_state.cam[2]);
368bec0d4a84f7 drivers/net/ethernet/octeon/octeon_mgmt.c David Daney 2012-07-05 623 cvmx_write_csr(p->agl + AGL_GMX_RX_ADR_CAM3, cam_state.cam[3]);
368bec0d4a84f7 drivers/net/ethernet/octeon/octeon_mgmt.c David Daney 2012-07-05 624 cvmx_write_csr(p->agl + AGL_GMX_RX_ADR_CAM4, cam_state.cam[4]);
368bec0d4a84f7 drivers/net/ethernet/octeon/octeon_mgmt.c David Daney 2012-07-05 625 cvmx_write_csr(p->agl + AGL_GMX_RX_ADR_CAM5, cam_state.cam[5]);
368bec0d4a84f7 drivers/net/ethernet/octeon/octeon_mgmt.c David Daney 2012-07-05 626 cvmx_write_csr(p->agl + AGL_GMX_RX_ADR_CAM_EN, cam_state.cam_mask);
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 627
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 628 /* Restore packet I/O. */
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 629 agl_gmx_prtx.s.en = prev_packet_enable;
368bec0d4a84f7 drivers/net/ethernet/octeon/octeon_mgmt.c David Daney 2012-07-05 630 cvmx_write_csr(p->agl + AGL_GMX_PRT_CFG, agl_gmx_prtx.u64);
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 631
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 632 spin_unlock_irqrestore(&p->lock, flags);
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 633 }
d6aa60a10b2f50 drivers/net/octeon/octeon_mgmt.c David Daney 2009-10-14 634
:::::: The code at line 596 was first introduced by commit
:::::: d6aa60a10b2f5068e331ca2936b1e6c248ae37c1 NET: Add Ethernet driver for Octeon MGMT devices.
:::::: TO: David Daney <ddaney@...iumnetworks.com>
:::::: CC: Ralf Baechle <ralf@...ux-mips.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (19434 bytes)
Powered by blists - more mailing lists