public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Frank Li <Frank.Li@nxp.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org,
	Jon Mason <jdmason@kudzu.us>
Subject: [jonmason-ntb:ntb-next-hacking 18/18] drivers/pci/endpoint/functions/pci-epf-vntb.c:560:56: warning: variable 'align' is uninitialized when used here
Date: Sun, 14 Aug 2022 10:14:34 +0800	[thread overview]
Message-ID: <202208141017.cwJ0JXde-lkp@intel.com> (raw)

tree:   https://github.com/jonmason/ntb ntb-next-hacking
head:   d90921d21692b59734d2452efea346217a526f44
commit: d90921d21692b59734d2452efea346217a526f44 [18/18] pcie: endpoint: pci-epf-vntb: add endpoint msi support
config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20220814/202208141017.cwJ0JXde-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 5f1c7e2cc5a3c07cbc2412e851a7283c1841f520)
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
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/jonmason/ntb/commit/d90921d21692b59734d2452efea346217a526f44
        git remote add jonmason-ntb https://github.com/jonmason/ntb
        git fetch --no-tags jonmason-ntb ntb-next-hacking
        git checkout d90921d21692b59734d2452efea346217a526f44
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/pci/endpoint/functions/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/pci/endpoint/functions/pci-epf-vntb.c:541:33: warning: variable 'epc_features' set but not used [-Wunused-but-set-variable]
           const struct pci_epc_features *epc_features;
                                          ^
>> drivers/pci/endpoint/functions/pci-epf-vntb.c:560:56: warning: variable 'align' is uninitialized when used here [-Wuninitialized]
                   mw_addr = pci_epf_alloc_space(ntb->epf, size, barno, align, 0);
                                                                        ^~~~~
   drivers/pci/endpoint/functions/pci-epf-vntb.c:542:11: note: initialize the variable 'align' to silence this warning
           u32 align;
                    ^
                     = 0
   2 warnings generated.


vim +/align +560 drivers/pci/endpoint/functions/pci-epf-vntb.c

d90921d21692b59 Frank Li 2022-07-07  534  
53efbaa43643f36 Frank Li 2022-02-22  535  /**
53efbaa43643f36 Frank Li 2022-02-22  536   * epf_ntb_db_bar_init() - Configure Doorbell window BARs
53efbaa43643f36 Frank Li 2022-02-22  537   * @ntb: NTB device that facilitates communication between HOST and vHOST
53efbaa43643f36 Frank Li 2022-02-22  538   */
53efbaa43643f36 Frank Li 2022-02-22  539  static int epf_ntb_db_bar_init(struct epf_ntb *ntb)
53efbaa43643f36 Frank Li 2022-02-22  540  {
53efbaa43643f36 Frank Li 2022-02-22  541  	const struct pci_epc_features *epc_features;
53efbaa43643f36 Frank Li 2022-02-22  542  	u32 align;
53efbaa43643f36 Frank Li 2022-02-22  543  	struct device *dev = &ntb->epf->dev;
53efbaa43643f36 Frank Li 2022-02-22  544  	int ret;
53efbaa43643f36 Frank Li 2022-02-22  545  	struct pci_epf_bar *epf_bar;
d90921d21692b59 Frank Li 2022-07-07  546  	void __iomem *mw_addr = NULL;
53efbaa43643f36 Frank Li 2022-02-22  547  	enum pci_barno barno;
d90921d21692b59 Frank Li 2022-07-07  548  	size_t size;
53efbaa43643f36 Frank Li 2022-02-22  549  
53efbaa43643f36 Frank Li 2022-02-22  550  	epc_features = pci_epc_get_features(ntb->epf->epc,
53efbaa43643f36 Frank Li 2022-02-22  551  					    ntb->epf->func_no,
53efbaa43643f36 Frank Li 2022-02-22  552  					    ntb->epf->vfunc_no);
53efbaa43643f36 Frank Li 2022-02-22  553  
d90921d21692b59 Frank Li 2022-07-07  554  	size = epf_ntb_db_size(ntb);
53efbaa43643f36 Frank Li 2022-02-22  555  
53efbaa43643f36 Frank Li 2022-02-22  556  	barno = ntb->epf_ntb_bar[BAR_DB];
d90921d21692b59 Frank Li 2022-07-07  557  	epf_bar = &ntb->epf->bar[barno];
53efbaa43643f36 Frank Li 2022-02-22  558  
d90921d21692b59 Frank Li 2022-07-07  559  	if (!ntb->epf_db_phy) {
53efbaa43643f36 Frank Li 2022-02-22 @560  		mw_addr = pci_epf_alloc_space(ntb->epf, size, barno, align, 0);
53efbaa43643f36 Frank Li 2022-02-22  561  		if (!mw_addr) {
53efbaa43643f36 Frank Li 2022-02-22  562  			dev_err(dev, "Failed to allocate OB address\n");
53efbaa43643f36 Frank Li 2022-02-22  563  			return -ENOMEM;
53efbaa43643f36 Frank Li 2022-02-22  564  		}
d90921d21692b59 Frank Li 2022-07-07  565  	} else {
d90921d21692b59 Frank Li 2022-07-07  566  		epf_bar->phys_addr = ntb->epf_db_phy;
d90921d21692b59 Frank Li 2022-07-07  567  		epf_bar->barno = barno;
d90921d21692b59 Frank Li 2022-07-07  568  		epf_bar->size = size;
d90921d21692b59 Frank Li 2022-07-07  569  	}
53efbaa43643f36 Frank Li 2022-02-22  570  
53efbaa43643f36 Frank Li 2022-02-22  571  	ntb->epf_db = mw_addr;
53efbaa43643f36 Frank Li 2022-02-22  572  
53efbaa43643f36 Frank Li 2022-02-22  573  	ret = pci_epc_set_bar(ntb->epf->epc, ntb->epf->func_no, ntb->epf->vfunc_no, epf_bar);
53efbaa43643f36 Frank Li 2022-02-22  574  	if (ret) {
53efbaa43643f36 Frank Li 2022-02-22  575  		dev_err(dev, "Doorbell BAR set failed\n");
53efbaa43643f36 Frank Li 2022-02-22  576  			goto err_alloc_peer_mem;
53efbaa43643f36 Frank Li 2022-02-22  577  	}
53efbaa43643f36 Frank Li 2022-02-22  578  	return ret;
53efbaa43643f36 Frank Li 2022-02-22  579  
53efbaa43643f36 Frank Li 2022-02-22  580  err_alloc_peer_mem:
53efbaa43643f36 Frank Li 2022-02-22  581  	pci_epc_mem_free_addr(ntb->epf->epc, epf_bar->phys_addr, mw_addr, epf_bar->size);
53efbaa43643f36 Frank Li 2022-02-22  582  	return -1;
53efbaa43643f36 Frank Li 2022-02-22  583  }
53efbaa43643f36 Frank Li 2022-02-22  584  

:::::: The code at line 560 was first introduced by commit
:::::: 53efbaa43643f36d203700e7f436eaac11695274 PCI: endpoint: Support NTB transfer between RC and EP

:::::: TO: Frank Li <Frank.Li@nxp.com>
:::::: CC: Jon Mason <jdmason@kudzu.us>

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

                 reply	other threads:[~2022-08-14  2:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202208141017.cwJ0JXde-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Frank.Li@nxp.com \
    --cc=jdmason@kudzu.us \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntb@googlegroups.com \
    --cc=llvm@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox