linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: ngene: avoid unused variable warning
@ 2018-03-13 13:06 Arnd Bergmann
  2018-03-13 16:38 ` Daniel Scheller
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-03-13 13:06 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Daniel Scheller
  Cc: Arnd Bergmann, Binoy Jayan, Jasmin Jessich, linux-media, linux-kernel

The newly added pdev variable is only used in an #ifdef, causing a
build warning without CONFIG_PCI_MSI, unless we move the declaration
inside the same #ifdef:

drivers/media/pci/ngene/ngene-core.c: In function 'ngene_start':
drivers/media/pci/ngene/ngene-core.c:1328:17: error: unused variable 'pdev' [-Werror=unused-variable]

Fixes: 6795bf626482 ("media: ngene: convert kernellog printing from printk() to dev_*() macros")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/media/pci/ngene/ngene-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/pci/ngene/ngene-core.c b/drivers/media/pci/ngene/ngene-core.c
index 3b9a1bfaf6c0..25f16833a475 100644
--- a/drivers/media/pci/ngene/ngene-core.c
+++ b/drivers/media/pci/ngene/ngene-core.c
@@ -1325,7 +1325,6 @@ static int ngene_buffer_config(struct ngene *dev)
 
 static int ngene_start(struct ngene *dev)
 {
-	struct device *pdev = &dev->pci_dev->dev;
 	int stat;
 	int i;
 
@@ -1359,6 +1358,7 @@ static int ngene_start(struct ngene *dev)
 #ifdef CONFIG_PCI_MSI
 	/* enable MSI if kernel and card support it */
 	if (pci_msi_enabled() && dev->card_info->msi_supported) {
+		struct device *pdev = &dev->pci_dev->dev;
 		unsigned long flags;
 
 		ngwritel(0, NGENE_INT_ENABLE);
-- 
2.9.0

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

* Re: [PATCH] media: ngene: avoid unused variable warning
  2018-03-13 13:06 [PATCH] media: ngene: avoid unused variable warning Arnd Bergmann
@ 2018-03-13 16:38 ` Daniel Scheller
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Scheller @ 2018-03-13 16:38 UTC (permalink / raw)
  To: Arnd Bergmann, Mauro Carvalho Chehab
  Cc: Binoy Jayan, Jasmin Jessich, linux-media, linux-kernel

Am Tue, 13 Mar 2018 14:06:03 +0100
schrieb Arnd Bergmann <arnd@arndb.de>:

> The newly added pdev variable is only used in an #ifdef, causing a
> build warning without CONFIG_PCI_MSI, unless we move the declaration
> inside the same #ifdef:
> 
> drivers/media/pci/ngene/ngene-core.c: In function 'ngene_start':
> drivers/media/pci/ngene/ngene-core.c:1328:17: error: unused variable 'pdev' [-Werror=unused-variable]
> 
> Fixes: 6795bf626482 ("media: ngene: convert kernellog printing from printk() to dev_*() macros")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Daniel Scheller <d.scheller@gmx.net>

Thanks!

> ---
>  drivers/media/pci/ngene/ngene-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/pci/ngene/ngene-core.c b/drivers/media/pci/ngene/ngene-core.c
> index 3b9a1bfaf6c0..25f16833a475 100644
> --- a/drivers/media/pci/ngene/ngene-core.c
> +++ b/drivers/media/pci/ngene/ngene-core.c
> @@ -1325,7 +1325,6 @@ static int ngene_buffer_config(struct ngene *dev)
>  
>  static int ngene_start(struct ngene *dev)
>  {
> -	struct device *pdev = &dev->pci_dev->dev;
>  	int stat;
>  	int i;
>  
> @@ -1359,6 +1358,7 @@ static int ngene_start(struct ngene *dev)
>  #ifdef CONFIG_PCI_MSI
>  	/* enable MSI if kernel and card support it */
>  	if (pci_msi_enabled() && dev->card_info->msi_supported) {
> +		struct device *pdev = &dev->pci_dev->dev;
>  		unsigned long flags;
>  
>  		ngwritel(0, NGENE_INT_ENABLE);

Best regards,
Daniel Scheller
-- 
https://github.com/herrnst

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

end of thread, other threads:[~2018-03-13 16:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-13 13:06 [PATCH] media: ngene: avoid unused variable warning Arnd Bergmann
2018-03-13 16:38 ` Daniel Scheller

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).