Skip to contentSkip to conversation

PCI: cadence: Fix unused-but-set-variable warning

PATCH In review Wei Yongjun 2 participants 2 messages Jul 25, 2020 – Jul 28, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: cadence: Fix unused-but-set-variable warning

Gcc report warning as followings:

drivers/pci/controller/cadence/pcie-cadence-ep.c:390:33: warning:
variable 'vec_ctrl' set but not used [-Wunused-but-set-variable]
390 | u32 tbl_offset, msg_data, reg, vec_ctrl;
| ^~~~~~~~

This variable is not used so this commit removing it.

Fixes dae15ff2c7a9 ("PCI: cadence: Add MSI-X support to Endpoint driver")
---
 drivers/pci/controller/cadence/pcie-cadence-ep.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/controller/cadence/pcie-cadence-ep.c +1 -2
index 87c76341eab4..ec1306da301f 100644
@@ -387,7 +387,7 @@ static int cdns_pcie_ep_send_msix_irq(struct cdns_pcie_ep *ep, u8 fn,
 				      u16 interrupt_num)
 {
 	u32 cap = CDNS_PCIE_EP_FUNC_MSIX_CAP_OFFSET;
-	u32 tbl_offset, msg_data, reg, vec_ctrl;
+	u32 tbl_offset, msg_data, reg;
 	struct cdns_pcie *pcie = &ep->pcie;
 	struct pci_epf_msix_tbl *msix_tbl;
 	struct cdns_pcie_epf *epf;
@@ -410,7 +410,6 @@ static int cdns_pcie_ep_send_msix_irq(struct cdns_pcie_ep *ep, u8 fn,
 	msix_tbl = epf->epf_bar[bir]->addr + tbl_offset;
 	msg_addr = msix_tbl[(interrupt_num - 1)].msg_addr;
 	msg_data = msix_tbl[(interrupt_num - 1)].msg_data;
-	vec_ctrl = msix_tbl[(interrupt_num - 1)].vector_ctrl;
 
 	/* Set the outbound region if needed. */
 	if (ep->irq_pci_addr != (msg_addr & ~pci_addr_mask) ||
#1 lore raw
Quoted 7 lines · Wei Yongjun

Gcc report warning as followings:

drivers/pci/controller/cadence/pcie-cadence-ep.c:390:33: warning:
variable 'vec_ctrl' set but not used [-Wunused-but-set-variable]
390 | u32 tbl_offset, msg_data, reg, vec_ctrl;
| ^~~~~~~~

Quoted 8 lines

This variable is not used so this commit removing it.

Fixes dae15ff2c7a9 ("PCI: cadence: Add MSI-X support to Endpoint driver")
---
 drivers/pci/controller/cadence/pcie-cadence-ep.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Squashed in the original commit, thanks.

Lorenzo

Quoted 22 lines
drivers/pci/controller/cadence/pcie-cadence-ep.c +1 -2
index 87c76341eab4..ec1306da301f 100644
@@ -387,7 +387,7 @@ static int cdns_pcie_ep_send_msix_irq(struct cdns_pcie_ep *ep, u8 fn,
 				      u16 interrupt_num)
 {
 	u32 cap = CDNS_PCIE_EP_FUNC_MSIX_CAP_OFFSET;
-	u32 tbl_offset, msg_data, reg, vec_ctrl;
+	u32 tbl_offset, msg_data, reg;
 	struct cdns_pcie *pcie = &ep->pcie;
 	struct pci_epf_msix_tbl *msix_tbl;
 	struct cdns_pcie_epf *epf;
@@ -410,7 +410,6 @@ static int cdns_pcie_ep_send_msix_irq(struct cdns_pcie_ep *ep, u8 fn,
 	msix_tbl = epf->epf_bar[bir]->addr + tbl_offset;
 	msg_addr = msix_tbl[(interrupt_num - 1)].msg_addr;
 	msg_data = msix_tbl[(interrupt_num - 1)].msg_data;
-	vec_ctrl = msix_tbl[(interrupt_num - 1)].vector_ctrl;
 
 	/* Set the outbound region if needed. */
 	if (ep->irq_pci_addr != (msg_addr & ~pci_addr_mask) ||