linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: pcie-candence-ep: remove redundant variable mmc
@ 2018-07-11  8:01 Colin King
  2018-07-11  8:16 ` Alan Douglas
  2018-07-13 14:15 ` Lorenzo Pieralisi
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2018-07-11  8:01 UTC (permalink / raw)
  To: Alan Douglas, Lorenzo Pieralisi, Bjorn Helgaas, linux-pci
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable mmc is being assigned but is never used hence it is redundant
and can be removed.

Cleans up clang warning:
warning: variable 'mmc' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/pci/controller/pcie-cadence-ep.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pci/controller/pcie-cadence-ep.c b/drivers/pci/controller/pcie-cadence-ep.c
index e3fe4124e3af..63549e03eae8 100644
--- a/drivers/pci/controller/pcie-cadence-ep.c
+++ b/drivers/pci/controller/pcie-cadence-ep.c
@@ -238,7 +238,7 @@ static int cdns_pcie_ep_get_msi(struct pci_epc *epc, u8 fn)
 	struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
 	struct cdns_pcie *pcie = &ep->pcie;
 	u32 cap = CDNS_PCIE_EP_FUNC_MSI_CAP_OFFSET;
-	u16 flags, mmc, mme;
+	u16 flags, mme;
 
 	/* Validate that the MSI feature is actually enabled. */
 	flags = cdns_pcie_ep_fn_readw(pcie, fn, cap + PCI_MSI_FLAGS);
@@ -249,7 +249,6 @@ static int cdns_pcie_ep_get_msi(struct pci_epc *epc, u8 fn)
 	 * Get the Multiple Message Enable bitfield from the Message Control
 	 * register.
 	 */
-	mmc = (flags & PCI_MSI_FLAGS_QMASK) >> 1;
 	mme = (flags & PCI_MSI_FLAGS_QSIZE) >> 4;
 
 	return mme;
-- 
2.17.1


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

* RE: [PATCH] PCI: pcie-candence-ep: remove redundant variable mmc
  2018-07-11  8:01 [PATCH] PCI: pcie-candence-ep: remove redundant variable mmc Colin King
@ 2018-07-11  8:16 ` Alan Douglas
  2018-07-13 14:15 ` Lorenzo Pieralisi
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Douglas @ 2018-07-11  8:16 UTC (permalink / raw)
  To: Colin King, Lorenzo Pieralisi, Bjorn Helgaas, linux-pci
  Cc: kernel-janitors, linux-kernel

On 11 July 2018 09:01, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable mmc is being assigned but is never used hence it is redundant
> and can be removed.
> 
> Cleans up clang warning:
> warning: variable 'mmc' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/pci/controller/pcie-cadence-ep.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/controller/pcie-cadence-ep.c b/drivers/pci/controller/pcie-cadence-ep.c
> index e3fe4124e3af..63549e03eae8 100644
> --- a/drivers/pci/controller/pcie-cadence-ep.c
> +++ b/drivers/pci/controller/pcie-cadence-ep.c
> @@ -238,7 +238,7 @@ static int cdns_pcie_ep_get_msi(struct pci_epc *epc, u8 fn)
>  	struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
>  	struct cdns_pcie *pcie = &ep->pcie;
>  	u32 cap = CDNS_PCIE_EP_FUNC_MSI_CAP_OFFSET;
> -	u16 flags, mmc, mme;
> +	u16 flags, mme;
> 
>  	/* Validate that the MSI feature is actually enabled. */
>  	flags = cdns_pcie_ep_fn_readw(pcie, fn, cap + PCI_MSI_FLAGS);
> @@ -249,7 +249,6 @@ static int cdns_pcie_ep_get_msi(struct pci_epc *epc, u8 fn)
>  	 * Get the Multiple Message Enable bitfield from the Message Control
>  	 * register.
>  	 */
> -	mmc = (flags & PCI_MSI_FLAGS_QMASK) >> 1;
>  	mme = (flags & PCI_MSI_FLAGS_QSIZE) >> 4;
> 
>  	return mme;
> --
> 2.17.1
Thanks for spotting this, mmc is not needed here, just interested in mme.
Acked-by: Alan Douglas <adouglas@cadence.com>


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

* Re: [PATCH] PCI: pcie-candence-ep: remove redundant variable mmc
  2018-07-11  8:01 [PATCH] PCI: pcie-candence-ep: remove redundant variable mmc Colin King
  2018-07-11  8:16 ` Alan Douglas
@ 2018-07-13 14:15 ` Lorenzo Pieralisi
  1 sibling, 0 replies; 3+ messages in thread
From: Lorenzo Pieralisi @ 2018-07-13 14:15 UTC (permalink / raw)
  To: Colin King
  Cc: Alan Douglas, Bjorn Helgaas, linux-pci, kernel-janitors, linux-kernel

On Wed, Jul 11, 2018 at 09:01:03AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable mmc is being assigned but is never used hence it is redundant
> and can be removed.
> 
> Cleans up clang warning:
> warning: variable 'mmc' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/pci/controller/pcie-cadence-ep.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied to pci/cadence for v4.19, thanks.

Lorenzo

> diff --git a/drivers/pci/controller/pcie-cadence-ep.c b/drivers/pci/controller/pcie-cadence-ep.c
> index e3fe4124e3af..63549e03eae8 100644
> --- a/drivers/pci/controller/pcie-cadence-ep.c
> +++ b/drivers/pci/controller/pcie-cadence-ep.c
> @@ -238,7 +238,7 @@ static int cdns_pcie_ep_get_msi(struct pci_epc *epc, u8 fn)
>  	struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
>  	struct cdns_pcie *pcie = &ep->pcie;
>  	u32 cap = CDNS_PCIE_EP_FUNC_MSI_CAP_OFFSET;
> -	u16 flags, mmc, mme;
> +	u16 flags, mme;
>  
>  	/* Validate that the MSI feature is actually enabled. */
>  	flags = cdns_pcie_ep_fn_readw(pcie, fn, cap + PCI_MSI_FLAGS);
> @@ -249,7 +249,6 @@ static int cdns_pcie_ep_get_msi(struct pci_epc *epc, u8 fn)
>  	 * Get the Multiple Message Enable bitfield from the Message Control
>  	 * register.
>  	 */
> -	mmc = (flags & PCI_MSI_FLAGS_QMASK) >> 1;
>  	mme = (flags & PCI_MSI_FLAGS_QSIZE) >> 4;
>  
>  	return mme;
> -- 
> 2.17.1
> 

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

end of thread, other threads:[~2018-07-13 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-11  8:01 [PATCH] PCI: pcie-candence-ep: remove redundant variable mmc Colin King
2018-07-11  8:16 ` Alan Douglas
2018-07-13 14:15 ` 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).