From: kernel test robot <yujie.liu@intel.com>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: <llvm@lists.linux.dev>, <kbuild-all@lists.01.org>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
Vignesh Raghavendra <vigneshr@ti.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Bjorn Helgaas <helgaas@kernel.org>
Subject: [ti:ti-rt-linux-5.10.y 3870/9320] drivers/pci/endpoint/pci-epf-core.c:84:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
Date: Sun, 19 Sep 2021 18:29:30 +0800 [thread overview]
Message-ID: <bd10d88c-44b6-6b94-2484-44800b3afc30@intel.com> (raw)
In-Reply-To: <202109180544.tpByJYd3-lkp@intel.com>
[-- Attachment #1: Type: text/plain, Size: 5230 bytes --]
tree: git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-rt-linux-5.10.y
head: 716065a9435e7c06986b8497aa853a7b747a9570
commit: 5fe4c2dfaa4e6413f98aedd00c8b2b372e5b0103 [3870/9320] PCI: endpoint: Add support to associate secondary EPC with EPF
:::::: branch date: 2 days ago
:::::: commit date: 6 months ago
config: riscv-randconfig-c006-20210916 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c8b3d7d6d6de37af68b2f379d0e37304f78e115f)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git fetch --no-tags ti ti-rt-linux-5.10.y
git checkout 5fe4c2dfaa4e6413f98aedd00c8b2b372e5b0103
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (prefixed by >>)
>> drivers/pci/endpoint/pci-epf-core.c:84:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = epf->epc->dev.parent;
^~~ ~~~~~~~~~~~~~~~~~~~~
vim +/dev +84 drivers/pci/endpoint/pci-epf-core.c
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 71
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 72 /**
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 73 * pci_epf_free_space() - free the allocated PCI EPF register space
9b41d19aff4090 Krzysztof Kozlowski 2020-07-29 74 * @epf: the EPF device from whom to free the memory
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 75 * @addr: the virtual address of the PCI EPF register space
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 76 * @bar: the BAR number corresponding to the register space
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 77 * @type: Identifies if the allocated space is for primary EPC or secondary EPC
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 78 *
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 79 * Invoke to free the allocated PCI EPF register space.
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 80 */
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 81 void pci_epf_free_space(struct pci_epf *epf, void *addr, enum pci_barno bar,
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 82 enum pci_epc_interface_type type)
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 83 {
b330104fa76df3 Kishon Vijay Abraham I 2018-01-11 @84 struct device *dev = epf->epc->dev.parent;
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 85 struct pci_epf_bar *epf_bar;
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 86 struct pci_epc *epc;
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 87
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 88 if (!addr)
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 89 return;
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 90
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 91 if (type == PRIMARY_INTERFACE) {
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 92 epc = epf->epc;
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 93 epf_bar = epf->bar;
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 94 } else {
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 95 epc = epf->sec_epc;
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 96 epf_bar = epf->sec_epc_bar;
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 97 }
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 98
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 99 dev = epc->dev.parent;
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 100 dma_free_coherent(dev, epf_bar[bar].size, addr,
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 101 epf_bar[bar].phys_addr);
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 102
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 103 epf_bar[bar].phys_addr = 0;
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 104 epf_bar[bar].addr = NULL;
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 105 epf_bar[bar].size = 0;
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 106 epf_bar[bar].barno = 0;
5fe4c2dfaa4e64 Kishon Vijay Abraham I 2021-03-19 107 epf_bar[bar].flags = 0;
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 108 }
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 109 EXPORT_SYMBOL_GPL(pci_epf_free_space);
5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10 110
:::::: The code at line 84 was first introduced by commit
:::::: b330104fa76df3eae6e199a23791fed5d35f06b4 PCI: endpoint: Use EPC's device in dma_alloc_coherent()/dma_free_coherent()
:::::: TO: Kishon Vijay Abraham I <kishon@ti.com>
:::::: CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34742 bytes --]
parent reply other threads:[~2021-09-19 10:29 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <202109180544.tpByJYd3-lkp@intel.com>]
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=bd10d88c-44b6-6b94-2484-44800b3afc30@intel.com \
--to=yujie.liu@intel.com \
--cc=helgaas@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=lorenzo.pieralisi@arm.com \
--cc=vigneshr@ti.com \
/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
all inboxes | Powered by JetHome®