Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1429398 > unrolled thread

linux-next: build warning after merge of the pci tree

Started byStephen Rothwell <sfr@canb.auug.org.au>
First post2016-06-23 04:00 +0200
Last post2016-06-24 10:10 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  linux-next: build warning after merge of the pci tree Stephen Rothwell <sfr@canb.auug.org.au> - 2016-06-23 04:00 +0200
    Re: linux-next: build warning after merge of the pci tree Bjorn Helgaas <helgaas@kernel.org> - 2016-06-23 18:50 +0200
      Re: linux-next: build warning after merge of the pci tree Johannes Thumshirn <jthumshirn@suse.de> - 2016-06-24 10:10 +0200

#1429398 — linux-next: build warning after merge of the pci tree

FromStephen Rothwell <sfr@canb.auug.org.au>
Date2016-06-23 04:00 +0200
Subjectlinux-next: build warning after merge of the pci tree
Message-ID<rN25Y-329-11@gated-at.bofh.it>
Hi Bjorn,

After merging the pci tree, today's linux-next build (x86_64 allmodconfig)
produced this warning:

drivers/misc/genwqe/card_base.c: In function 'genwqe_pci_remove':
drivers/misc/genwqe/card_base.c:1155:6: warning: unused variable 'bars' [-Wunused-variable]
  int bars;
      ^
drivers/misc/genwqe/card_base.c: In function 'genwqe_pci_setup':
drivers/misc/genwqe/card_base.c:1143:2: warning: 'bars' may be used uninitialized in this function [-Wmaybe-uninitialized]
  pci_release_selected_regions(pci_dev, bars);
  ^

Introduced by commit

  370b01694826 ("GenWQE: Use pci_(request|release)_mem_regions")

-- 
Cheers,
Stephen Rothwell

[toc] | [next] | [standalone]


#1429979

FromBjorn Helgaas <helgaas@kernel.org>
Date2016-06-23 18:50 +0200
Message-ID<rNfZg-4gz-9@gated-at.bofh.it>
In reply to#1429398
On Thu, Jun 23, 2016 at 11:51:54AM +1000, Stephen Rothwell wrote:
> Hi Bjorn,
> 
> After merging the pci tree, today's linux-next build (x86_64 allmodconfig)
> produced this warning:
> 
> drivers/misc/genwqe/card_base.c: In function 'genwqe_pci_remove':
> drivers/misc/genwqe/card_base.c:1155:6: warning: unused variable 'bars' [-Wunused-variable]
>   int bars;
>       ^
> drivers/misc/genwqe/card_base.c: In function 'genwqe_pci_setup':
> drivers/misc/genwqe/card_base.c:1143:2: warning: 'bars' may be used uninitialized in this function [-Wmaybe-uninitialized]
>   pci_release_selected_regions(pci_dev, bars);
>   ^
> 
> Introduced by commit
> 
>   370b01694826 ("GenWQE: Use pci_(request|release)_mem_regions")

Thanks, Stephen.  I made the following edits, which should resolve these
warnings.  Johannes, let me know if they look right to you.


diff --git a/drivers/misc/genwqe/card_base.c b/drivers/misc/genwqe/card_base.c
index cb398be..a70b853 100644
--- a/drivers/misc/genwqe/card_base.c
+++ b/drivers/misc/genwqe/card_base.c
@@ -1067,7 +1067,7 @@ static int genwqe_health_check_stop(struct genwqe_dev *cd)
  */
 static int genwqe_pci_setup(struct genwqe_dev *cd)
 {
-	int err, bars;
+	int err;
 	struct pci_dev *pci_dev = cd->pci_dev;
 
 	err = pci_enable_device_mem(pci_dev);
@@ -1140,7 +1140,7 @@ static int genwqe_pci_setup(struct genwqe_dev *cd)
  out_iounmap:
 	pci_iounmap(pci_dev, cd->mmio);
  out_release_resources:
-	pci_release_selected_regions(pci_dev, bars);
+	pci_release_mem_regions(pci_dev);
  err_disable_device:
 	pci_disable_device(pci_dev);
  err_out:
@@ -1152,7 +1152,6 @@ static int genwqe_pci_setup(struct genwqe_dev *cd)
  */
 static void genwqe_pci_remove(struct genwqe_dev *cd)
 {
-	int bars;
 	struct pci_dev *pci_dev = cd->pci_dev;
 
 	if (cd->mmio)

[toc] | [prev] | [next] | [standalone]


#1430443

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2016-06-24 10:10 +0200
Message-ID<rNulz-5yG-17@gated-at.bofh.it>
In reply to#1429979
On Thu, Jun 23, 2016 at 11:48:49AM -0500, Bjorn Helgaas wrote:
> On Thu, Jun 23, 2016 at 11:51:54AM +1000, Stephen Rothwell wrote:
> > Hi Bjorn,
> > 
> > After merging the pci tree, today's linux-next build (x86_64 allmodconfig)
> > produced this warning:
> > 
> > drivers/misc/genwqe/card_base.c: In function 'genwqe_pci_remove':
> > drivers/misc/genwqe/card_base.c:1155:6: warning: unused variable 'bars' [-Wunused-variable]
> >   int bars;
> >       ^
> > drivers/misc/genwqe/card_base.c: In function 'genwqe_pci_setup':
> > drivers/misc/genwqe/card_base.c:1143:2: warning: 'bars' may be used uninitialized in this function [-Wmaybe-uninitialized]
> >   pci_release_selected_regions(pci_dev, bars);
> >   ^
> > 
> > Introduced by commit
> > 
> >   370b01694826 ("GenWQE: Use pci_(request|release)_mem_regions")
> 
> Thanks, Stephen.  I made the following edits, which should resolve these
> warnings.  Johannes, let me know if they look right to you.
> 

Looks good, thanks.
	Johannes

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web