drivers/net/ethernet/atheros/ag71xx.c:994:38: warning: passing argument 2 of 'ag71xx_hw_set_macaddr' discards 'const' qualifier from pointer target type
From: kernel test robot
Date: Sun Jul 31 2022 - 19:23:43 EST
Hi Jakub,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 3d7cb6b04c3f3115719235cc6866b10326de34cd
commit: adeef3e32146a8d2a73c399dc6f5d76a449131b1 net: constify netdev->dev_addr
date: 8 months ago
config: mips-randconfig-r033-20220801 (https://download.01.org/0day-ci/archive/20220801/202208010713.jcG50gwa-lkp@xxxxxxxxx/config)
compiler: mips-linux-gcc (GCC) 12.1.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/torvalds/linux.git/commit/?id=adeef3e32146a8d2a73c399dc6f5d76a449131b1
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout adeef3e32146a8d2a73c399dc6f5d76a449131b1
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/net/ethernet/atheros/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
drivers/net/ethernet/atheros/ag71xx.c: In function 'ag71xx_fast_reset':
>> drivers/net/ethernet/atheros/ag71xx.c:994:38: warning: passing argument 2 of 'ag71xx_hw_set_macaddr' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
994 | ag71xx_hw_set_macaddr(ag, dev->dev_addr);
| ~~~^~~~~~~~~~
drivers/net/ethernet/atheros/ag71xx.c:949:69: note: expected 'unsigned char *' but argument is of type 'const unsigned char *'
949 | static void ag71xx_hw_set_macaddr(struct ag71xx *ag, unsigned char *mac)
| ~~~~~~~~~~~~~~~^~~
drivers/net/ethernet/atheros/ag71xx.c: In function 'ag71xx_open':
drivers/net/ethernet/atheros/ag71xx.c:1452:39: warning: passing argument 2 of 'ag71xx_hw_set_macaddr' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
1452 | ag71xx_hw_set_macaddr(ag, ndev->dev_addr);
| ~~~~^~~~~~~~~~
drivers/net/ethernet/atheros/ag71xx.c:949:69: note: expected 'unsigned char *' but argument is of type 'const unsigned char *'
949 | static void ag71xx_hw_set_macaddr(struct ag71xx *ag, unsigned char *mac)
| ~~~~~~~~~~~~~~~^~~
vim +994 drivers/net/ethernet/atheros/ag71xx.c
d51b6ce441d356 Oleksij Rempel 2019-05-24 961
d51b6ce441d356 Oleksij Rempel 2019-05-24 962 static void ag71xx_fast_reset(struct ag71xx *ag)
d51b6ce441d356 Oleksij Rempel 2019-05-24 963 {
d51b6ce441d356 Oleksij Rempel 2019-05-24 964 struct net_device *dev = ag->ndev;
d51b6ce441d356 Oleksij Rempel 2019-05-24 965 u32 rx_ds;
d51b6ce441d356 Oleksij Rempel 2019-05-24 966 u32 mii_reg;
d51b6ce441d356 Oleksij Rempel 2019-05-24 967
d51b6ce441d356 Oleksij Rempel 2019-05-24 968 ag71xx_hw_stop(ag);
d51b6ce441d356 Oleksij Rempel 2019-05-24 969
d51b6ce441d356 Oleksij Rempel 2019-05-24 970 mii_reg = ag71xx_rr(ag, AG71XX_REG_MII_CFG);
d51b6ce441d356 Oleksij Rempel 2019-05-24 971 rx_ds = ag71xx_rr(ag, AG71XX_REG_RX_DESC);
d51b6ce441d356 Oleksij Rempel 2019-05-24 972
d51b6ce441d356 Oleksij Rempel 2019-05-24 973 ag71xx_tx_packets(ag, true);
d51b6ce441d356 Oleksij Rempel 2019-05-24 974
d51b6ce441d356 Oleksij Rempel 2019-05-24 975 reset_control_assert(ag->mac_reset);
d51b6ce441d356 Oleksij Rempel 2019-05-24 976 usleep_range(10, 20);
d51b6ce441d356 Oleksij Rempel 2019-05-24 977 reset_control_deassert(ag->mac_reset);
d51b6ce441d356 Oleksij Rempel 2019-05-24 978 usleep_range(10, 20);
d51b6ce441d356 Oleksij Rempel 2019-05-24 979
d51b6ce441d356 Oleksij Rempel 2019-05-24 980 ag71xx_dma_reset(ag);
d51b6ce441d356 Oleksij Rempel 2019-05-24 981 ag71xx_hw_setup(ag);
d51b6ce441d356 Oleksij Rempel 2019-05-24 982 ag->tx_ring.curr = 0;
d51b6ce441d356 Oleksij Rempel 2019-05-24 983 ag->tx_ring.dirty = 0;
d51b6ce441d356 Oleksij Rempel 2019-05-24 984 netdev_reset_queue(ag->ndev);
d51b6ce441d356 Oleksij Rempel 2019-05-24 985
d51b6ce441d356 Oleksij Rempel 2019-05-24 986 /* setup max frame length */
d51b6ce441d356 Oleksij Rempel 2019-05-24 987 ag71xx_wr(ag, AG71XX_REG_MAC_MFL,
d51b6ce441d356 Oleksij Rempel 2019-05-24 988 ag71xx_max_frame_len(ag->ndev->mtu));
d51b6ce441d356 Oleksij Rempel 2019-05-24 989
d51b6ce441d356 Oleksij Rempel 2019-05-24 990 ag71xx_wr(ag, AG71XX_REG_RX_DESC, rx_ds);
d51b6ce441d356 Oleksij Rempel 2019-05-24 991 ag71xx_wr(ag, AG71XX_REG_TX_DESC, ag->tx_ring.descs_dma);
d51b6ce441d356 Oleksij Rempel 2019-05-24 992 ag71xx_wr(ag, AG71XX_REG_MII_CFG, mii_reg);
d51b6ce441d356 Oleksij Rempel 2019-05-24 993
d51b6ce441d356 Oleksij Rempel 2019-05-24 @994 ag71xx_hw_set_macaddr(ag, dev->dev_addr);
d51b6ce441d356 Oleksij Rempel 2019-05-24 995 }
d51b6ce441d356 Oleksij Rempel 2019-05-24 996
:::::: The code at line 994 was first introduced by commit
:::::: d51b6ce441d356369387d20bc1de5f2edb0ab71e net: ethernet: add ag71xx driver
:::::: TO: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
:::::: CC: David S. Miller <davem@xxxxxxxxxxxxx>
--
0-DAY CI Kernel Test Service
https://01.org/lkp