Subject: Re: [PATCH v2 net 7/7] hsr: Use a single struct for self_node.

From: kernel test robot <[email-masked]>
Date: Fri, 25 Nov 2022 08:46:51 +0800

Hi Sebastian,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net/master]

url:    https://github.com/intel-lab-lkp/linux/commits/Sebastian-Andrzej-Siewior/Revert-net-hsr-use-hlist_head-instead-of-list_head-for-mac-addresses/20221122-024634
patch link:    https://lore.kernel.org/r/20221121174605.2456845-8-bigeasy%40linutronix.de
patch subject: [PATCH v2 net 7/7] hsr: Use a single struct for self_node.
config: ia64-randconfig-s033-20221124
compiler: ia64-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/intel-lab-lkp/linux/commit/80e94f7b5ffe417abb25777833f59121dae6b17f
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Sebastian-Andrzej-Siewior/Revert-net-hsr-use-hlist_head-instead-of-list_head-for-mac-addresses/20221122-024634
        git checkout 80e94f7b5ffe417abb25777833f59121dae6b17f
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/hid/ net/hsr/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email-masked]>

sparse warnings: (new ones prefixed by >>)
>> net/hsr/hsr_framereg.c:45:14: sparse: sparse: incompatible types in comparison expression (different address spaces):
>> net/hsr/hsr_framereg.c:45:14: sparse:    struct hsr_self_node [noderef] __rcu *
>> net/hsr/hsr_framereg.c:45:14: sparse:    struct hsr_self_node *
   net/hsr/hsr_framereg.c:91:15: sparse: sparse: incompatible types in comparison expression (different address spaces):
   net/hsr/hsr_framereg.c:91:15: sparse:    struct hsr_self_node [noderef] __rcu *
   net/hsr/hsr_framereg.c:91:15: sparse:    struct hsr_self_node *
   net/hsr/hsr_framereg.c:91:15: sparse: sparse: incompatible types in comparison expression (different address spaces):
   net/hsr/hsr_framereg.c:91:15: sparse:    struct hsr_self_node [noderef] __rcu *
   net/hsr/hsr_framereg.c:91:15: sparse:    struct hsr_self_node *
   net/hsr/hsr_framereg.c:105:15: sparse: sparse: incompatible types in comparison expression (different address spaces):
   net/hsr/hsr_framereg.c:105:15: sparse:    struct hsr_self_node [noderef] __rcu *
   net/hsr/hsr_framereg.c:105:15: sparse:    struct hsr_self_node *
   net/hsr/hsr_framereg.c:105:15: sparse: sparse: incompatible types in comparison expression (different address spaces):
   net/hsr/hsr_framereg.c:105:15: sparse:    struct hsr_self_node [noderef] __rcu *
   net/hsr/hsr_framereg.c:105:15: sparse:    struct hsr_self_node *

vim +45 net/hsr/hsr_framereg.c

    38	
    39	bool hsr_addr_is_self(struct hsr_priv *hsr, unsigned char *addr)
    40	{
    41		struct hsr_self_node *sn;
    42		bool ret = false;
    43	
    44		rcu_read_lock();
  > 45		sn = rcu_dereference(hsr->self_node);
    46		if (!sn) {
    47			WARN_ONCE(1, "HSR: No self node\n");
    48			goto out;
    49		}
    50	
    51		if (ether_addr_equal(addr, sn->macaddress_A) ||
    52		    ether_addr_equal(addr, sn->macaddress_B))
    53			ret = true;
    54	out:
    55		rcu_read_unlock();
    56		return ret;
    57	}
    58	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp