linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] PCI: cadence: Fix unused-but-set-variable warning
@ 2020-07-25  9:19 Wei Yongjun
  2020-07-28 10:36 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2020-07-25  9:19 UTC (permalink / raw)
  To: Hulk Robot, Tom Joseph, Lorenzo Pieralisi, Bjorn Helgaas, Alan Douglas
  Cc: Wei Yongjun, linux-pci

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 <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/pci/controller/cadence/pcie-cadence-ep.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pci/controller/cadence/pcie-cadence-ep.c b/drivers/pci/controller/cadence/pcie-cadence-ep.c
index 87c76341eab4..ec1306da301f 100644
--- a/drivers/pci/controller/cadence/pcie-cadence-ep.c
+++ b/drivers/pci/controller/cadence/pcie-cadence-ep.c
@@ -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) ||


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] PCI: cadence: Fix unused-but-set-variable warning
  2020-07-25  9:19 [PATCH -next] PCI: cadence: Fix unused-but-set-variable warning Wei Yongjun
@ 2020-07-28 10:36 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Pieralisi @ 2020-07-28 10:36 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Hulk Robot, Tom Joseph, Bjorn Helgaas, Alan Douglas, linux-pci

On Sat, Jul 25, 2020 at 05:19:45PM +0800, Wei Yongjun wrote:
> 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 <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/pci/controller/cadence/pcie-cadence-ep.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Squashed in the original commit, thanks.

Lorenzo

> diff --git a/drivers/pci/controller/cadence/pcie-cadence-ep.c b/drivers/pci/controller/cadence/pcie-cadence-ep.c
> index 87c76341eab4..ec1306da301f 100644
> --- a/drivers/pci/controller/cadence/pcie-cadence-ep.c
> +++ b/drivers/pci/controller/cadence/pcie-cadence-ep.c
> @@ -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) ||
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-28 10:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-25  9:19 [PATCH -next] PCI: cadence: Fix unused-but-set-variable warning Wei Yongjun
2020-07-28 10:36 ` Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).