Re: [PATCH net-next] net: ibm/emac: Constify struct mii_phy_def

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Christophe,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Christophe-JAILLET/net-ibm-emac-Constify-struct-mii_phy_def/20240807-195146
base:   net-next/main
patch link:    https://lore.kernel.org/r/dfc7876d660d700a840e64c35de0a6519e117539.1723031352.git.christophe.jaillet%40wanadoo.fr
patch subject: [PATCH net-next] net: ibm/emac: Constify struct mii_phy_def
config: powerpc-allyesconfig (https://download.01.org/0day-ci/archive/20240808/202408080850.QKqTbf5o-lkp@xxxxxxxxx/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 423aec6573df4424f90555468128e17073ddc69e)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240808/202408080850.QKqTbf5o-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408080850.QKqTbf5o-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

   In file included from drivers/net/ethernet/ibm/emac/core.c:28:
   In file included from include/linux/pci.h:38:
   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:14:
   In file included from arch/powerpc/include/asm/io.h:24:
   In file included from include/linux/mm.h:2228:
   include/linux/vmstat.h:500:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     500 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     501 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:507:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     507 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     508 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:519:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     519 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     520 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:528:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     528 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     529 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/ibm/emac/core.c:2648:23: error: cannot assign to non-static data member 'def' with const-qualified type 'const struct mii_phy_def *'
    2648 |         dev->phy.def->phy_id = dev->phy_dev->drv->phy_id;
         |         ~~~~~~~~~~~~~~~~~~~~ ^
   drivers/net/ethernet/ibm/emac/phy.h:50:28: note: non-static data member 'def' declared const here
      50 |         const struct mii_phy_def *def;
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
   drivers/net/ethernet/ibm/emac/core.c:2649:28: error: cannot assign to non-static data member 'def' with const-qualified type 'const struct mii_phy_def *'
    2649 |         dev->phy.def->phy_id_mask = dev->phy_dev->drv->phy_id_mask;
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~ ^
   drivers/net/ethernet/ibm/emac/phy.h:50:28: note: non-static data member 'def' declared const here
      50 |         const struct mii_phy_def *def;
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
   drivers/net/ethernet/ibm/emac/core.c:2650:21: error: cannot assign to non-static data member 'def' with const-qualified type 'const struct mii_phy_def *'
    2650 |         dev->phy.def->name = dev->phy_dev->drv->name;
         |         ~~~~~~~~~~~~~~~~~~ ^
   drivers/net/ethernet/ibm/emac/phy.h:50:28: note: non-static data member 'def' declared const here
      50 |         const struct mii_phy_def *def;
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
   drivers/net/ethernet/ibm/emac/core.c:2651:20: error: cannot assign to non-static data member 'def' with const-qualified type 'const struct mii_phy_def *'
    2651 |         dev->phy.def->ops = &emac_dt_mdio_phy_ops;
         |         ~~~~~~~~~~~~~~~~~ ^
   drivers/net/ethernet/ibm/emac/phy.h:50:28: note: non-static data member 'def' declared const here
      50 |         const struct mii_phy_def *def;
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
   drivers/net/ethernet/ibm/emac/core.c:2818:25: error: cannot assign to non-static data member 'def' with const-qualified type 'const struct mii_phy_def *'
    2818 |         dev->phy.def->features &= ~dev->phy_feat_exc;
         |         ~~~~~~~~~~~~~~~~~~~~~~ ^
   drivers/net/ethernet/ibm/emac/phy.h:50:28: note: non-static data member 'def' declared const here
      50 |         const struct mii_phy_def *def;
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
   5 warnings and 5 errors generated.


vim +2648 drivers/net/ethernet/ibm/emac/core.c

a577ca6badb526 Christian Lamparter 2017-02-20  2632  
a577ca6badb526 Christian Lamparter 2017-02-20  2633  static int emac_dt_phy_connect(struct emac_instance *dev,
a577ca6badb526 Christian Lamparter 2017-02-20  2634  			       struct device_node *phy_handle)
a577ca6badb526 Christian Lamparter 2017-02-20  2635  {
a577ca6badb526 Christian Lamparter 2017-02-20  2636  	dev->phy.def = devm_kzalloc(&dev->ofdev->dev, sizeof(*dev->phy.def),
a577ca6badb526 Christian Lamparter 2017-02-20  2637  				    GFP_KERNEL);
a577ca6badb526 Christian Lamparter 2017-02-20  2638  	if (!dev->phy.def)
a577ca6badb526 Christian Lamparter 2017-02-20  2639  		return -ENOMEM;
a577ca6badb526 Christian Lamparter 2017-02-20  2640  
a577ca6badb526 Christian Lamparter 2017-02-20  2641  	dev->phy_dev = of_phy_connect(dev->ndev, phy_handle, &emac_adjust_link,
a577ca6badb526 Christian Lamparter 2017-02-20  2642  				      0, dev->phy_mode);
a577ca6badb526 Christian Lamparter 2017-02-20  2643  	if (!dev->phy_dev) {
a577ca6badb526 Christian Lamparter 2017-02-20  2644  		dev_err(&dev->ofdev->dev, "failed to connect to PHY.\n");
a577ca6badb526 Christian Lamparter 2017-02-20  2645  		return -ENODEV;
a577ca6badb526 Christian Lamparter 2017-02-20  2646  	}
a577ca6badb526 Christian Lamparter 2017-02-20  2647  
a577ca6badb526 Christian Lamparter 2017-02-20 @2648  	dev->phy.def->phy_id = dev->phy_dev->drv->phy_id;
a577ca6badb526 Christian Lamparter 2017-02-20  2649  	dev->phy.def->phy_id_mask = dev->phy_dev->drv->phy_id_mask;
a577ca6badb526 Christian Lamparter 2017-02-20  2650  	dev->phy.def->name = dev->phy_dev->drv->name;
a577ca6badb526 Christian Lamparter 2017-02-20  2651  	dev->phy.def->ops = &emac_dt_mdio_phy_ops;
3c1bcc8614db10 Andrew Lunn         2018-11-10  2652  	ethtool_convert_link_mode_to_legacy_u32(&dev->phy.features,
3c1bcc8614db10 Andrew Lunn         2018-11-10  2653  						dev->phy_dev->supported);
a577ca6badb526 Christian Lamparter 2017-02-20  2654  	dev->phy.address = dev->phy_dev->mdio.addr;
a577ca6badb526 Christian Lamparter 2017-02-20  2655  	dev->phy.mode = dev->phy_dev->interface;
a577ca6badb526 Christian Lamparter 2017-02-20  2656  	return 0;
a577ca6badb526 Christian Lamparter 2017-02-20  2657  }
a577ca6badb526 Christian Lamparter 2017-02-20  2658  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux