Subject: port-i386/2880: kernel compilation problem + fix
To: None <gnats-bugs@gnats.netbsd.org>
From: Alasdair Baird <alasdair@wildcat.demon.co.uk>
List: netbsd-bugs
Date: 10/21/1996 22:55:41
>Number:         2880
>Category:       port-i386
>Synopsis:       kernel fails to compile
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 21 15:05:00 1996
>Last-Modified:
>Originator:     Alasdair Baird
>Organization:
Absolutely none whatsoever.
>Release:        NetBSD-current 21/10/96
>Environment:
	
System: NetBSD wildcat.demon.co.uk 1.2A NetBSD 1.2A (WILDCAT) #1: Sun Oct 20 22:31:01 BST 1996 root@wildcat.demon.co.uk:/usr/src/sys/arch/i386/compile/WILDCAT i386


>Description:

	Building a kernel on the i386 fails if PCI_CONF_MODE is
	defined, as the compiler throws up warnings about unused
	labels in /sys/arch/i386/pci/pci_machdep.c:

cc1: warnings being treated as errors
../../../../arch/i386/pci/pci_machdep.c: In function `pci_make_tag':
../../../../arch/i386/pci/pci_machdep.c:118: warning: label `mode1' defined but not used
../../../../arch/i386/pci/pci_machdep.c: In function `pci_conf_read':
../../../../arch/i386/pci/pci_machdep.c:159: warning: label `mode1' defined but not used
../../../../arch/i386/pci/pci_machdep.c: In function `pci_conf_write':
../../../../arch/i386/pci/pci_machdep.c:196: warning: label `mode1' defined but not used
*** Error code 1

Stop.

>How-To-Repeat:
	
>Fix:

	Add a few more #ifdefs:

*** pci_machdep.c.OLD   Mon Oct 14 17:10:05 1996
--- pci_machdep.c       Mon Oct 21 22:41:29 1996
***************
*** 115,121 ****
--- 115,123 ----
  #endif
  
  #if !defined(PCI_CONF_MODE) || (PCI_CONF_MODE == 1)
+ #if !defined(PCI_CONF_MODE)
  mode1:
+ #endif
        if (bus >= 256 || device >= 32 || function >= 8)
                panic("pci_make_tag: bad request");
  
***************
*** 125,131 ****
--- 127,135 ----
  #endif
  
  #if !defined(PCI_CONF_MODE) || (PCI_CONF_MODE == 2)
+ #if !defined(PCI_CONF_MODE)
  mode2:
+ #endif
        if (bus >= 256 || device >= 16 || function >= 8)
                panic("pci_make_tag: bad request");
  
***************
*** 156,162 ****
--- 160,168 ----
  #endif
  
  #if !defined(PCI_CONF_MODE) || (PCI_CONF_MODE == 1)
+ #if !defined(PCI_CONF_MODE)
  mode1:
+ #endif
        outl(PCI_MODE1_ADDRESS_REG, tag.mode1 | reg);
        data = inl(PCI_MODE1_DATA_REG);
        outl(PCI_MODE1_ADDRESS_REG, 0);
***************
*** 164,170 ****
--- 170,178 ----
  #endif
  
  #if !defined(PCI_CONF_MODE) || (PCI_CONF_MODE == 2)
+ #if !defined(PCI_CONF_MODE)
  mode2:
+ #endif
        outb(PCI_MODE2_ENABLE_REG, tag.mode2.enable);
        outb(PCI_MODE2_FORWARD_REG, tag.mode2.forward);
        data = inl(tag.mode2.port | reg);
***************
*** 193,206 ****
--- 201,218 ----
  #endif
  
  #if !defined(PCI_CONF_MODE) || (PCI_CONF_MODE == 1)
+ #if !defined(PCI_CONF_MODE)
  mode1:
+ #endif
        outl(PCI_MODE1_ADDRESS_REG, tag.mode1 | reg);
        outl(PCI_MODE1_DATA_REG, data);
        outl(PCI_MODE1_ADDRESS_REG, 0);
  #endif
  
  #if !defined(PCI_CONF_MODE) || (PCI_CONF_MODE == 2)
+ #if !defined(PCI_CONF_MODE)
  mode2:
+ #endif
        outb(PCI_MODE2_ENABLE_REG, tag.mode2.enable);
        outb(PCI_MODE2_FORWARD_REG, tag.mode2.forward);
        outl(tag.mode2.port | reg, data);

>Audit-Trail:
>Unformatted: