Hi Tom,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    
https://github.com/0day-ci/linux/commits/Tom-Parkin/add-ppp_generic-ioctl-s-to-bridge-channels/20201126-202933
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 
594e31bcebd6b8127ab8bcf37068ecef6c996459
config: alpha-randconfig-s032-20201126 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.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.3-151-g540c2c4b-dirty
        # 
https://github.com/0day-ci/linux/commit/d956f9918541d0b973ce241bd26020c3d08878db
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review 
Tom-Parkin/add-ppp_generic-ioctl-s-to-bridge-channels/20201126-202933
        git checkout d956f9918541d0b973ce241bd26020c3d08878db
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=alpha 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <l...@intel.com>


"sparse warnings: (new ones prefixed by >>)"
>> drivers/net/ppp/ppp_generic.c:641:9: sparse: sparse: incompatible types in 
>> comparison expression (different address spaces):
>> drivers/net/ppp/ppp_generic.c:641:9: sparse:    struct channel [noderef] 
>> __rcu *
>> drivers/net/ppp/ppp_generic.c:641:9: sparse:    struct channel *
   drivers/net/ppp/ppp_generic.c:644:9: sparse: sparse: incompatible types in 
comparison expression (different address spaces):
   drivers/net/ppp/ppp_generic.c:644:9: sparse:    struct channel [noderef] 
__rcu *
   drivers/net/ppp/ppp_generic.c:644:9: sparse:    struct channel *
   drivers/net/ppp/ppp_generic.c:666:16: sparse: sparse: incompatible types in 
comparison expression (different address spaces):
   drivers/net/ppp/ppp_generic.c:666:16: sparse:    struct channel [noderef] 
__rcu *
   drivers/net/ppp/ppp_generic.c:666:16: sparse:    struct channel *
   drivers/net/ppp/ppp_generic.c:672:20: sparse: sparse: incompatible types in 
comparison expression (different address spaces):
   drivers/net/ppp/ppp_generic.c:672:20: sparse:    struct channel [noderef] 
__rcu *
   drivers/net/ppp/ppp_generic.c:672:20: sparse:    struct channel *
   drivers/net/ppp/ppp_generic.c:680:9: sparse: sparse: incompatible types in 
comparison expression (different address spaces):
   drivers/net/ppp/ppp_generic.c:680:9: sparse:    struct channel [noderef] 
__rcu *
   drivers/net/ppp/ppp_generic.c:680:9: sparse:    struct channel *
   drivers/net/ppp/ppp_generic.c:681:9: sparse: sparse: incompatible types in 
comparison expression (different address spaces):
   drivers/net/ppp/ppp_generic.c:681:9: sparse:    struct channel [noderef] 
__rcu *
   drivers/net/ppp/ppp_generic.c:681:9: sparse:    struct channel *
   drivers/net/ppp/ppp_generic.c:2209:16: sparse: sparse: incompatible types in 
comparison expression (different address spaces):
   drivers/net/ppp/ppp_generic.c:2209:16: sparse:    struct channel [noderef] 
__rcu *
   drivers/net/ppp/ppp_generic.c:2209:16: sparse:    struct channel *

vim +641 drivers/net/ppp/ppp_generic.c

   609  
   610  /* Bridge one PPP channel to another.
   611   * When two channels are bridged, ppp_input on one channel is 
redirected to
   612   * the other's ops->start_xmit handler.
   613   * In order to safely bridge channels we must reject channels which are 
already
   614   * part of a bridge instance, or which form part of an existing unit.
   615   * Once successfully bridged, each channel holds a reference on the 
other
   616   * to prevent it being freed while the bridge is extant.
   617   */
   618  static int ppp_bridge_channels(struct channel *pch, struct channel 
*pchb)
   619  {
   620          int ret = -EALREADY;
   621  
   622          /* We need to take each channel upl for access to the 'ppp' 
field,
   623           * and each channel downl for write access to the 'bridge' 
field.
   624           */
   625  
   626          read_lock_bh(&pch->upl);
   627          if (pch->ppp)
   628                  goto out0;
   629  
   630          spin_lock(&pch->downl);
   631  
   632          read_lock_bh(&pchb->upl);
   633          if (pchb->ppp)
   634                  goto out1;
   635  
   636          spin_lock(&pchb->downl);
   637  
   638          if (pch->bridge || pchb->bridge)
   639                  goto out2;
   640  
 > 641          rcu_assign_pointer(pch->bridge, pchb);
   642          refcount_inc(&pchb->file.refcnt);
   643  
   644          rcu_assign_pointer(pchb->bridge, pch);
   645          refcount_inc(&pch->file.refcnt);
   646  
   647          ret = 0;
   648  
   649  out2:
   650          spin_unlock(&pchb->downl);
   651  out1:
   652          read_unlock_bh(&pchb->upl);
   653          spin_unlock(&pch->downl);
   654  out0:
   655          read_unlock_bh(&pch->upl);
   656  
   657          return ret;
   658  }
   659  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org

Attachment: .config.gz
Description: application/gzip

Reply via email to