PCI: cadence: Fix unused-but-set-variable warning
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")
Reported-by Hulk Robot <[email protected]>
Signed-off-by Wei Yongjun <[email protected]>
--- 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
@@ -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) ||
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 | u32tbl_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")Reported-by Hulk Robot <[email protected]>Signed-off-by Wei Yongjun <[email protected]>--- 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@@ -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) ||