NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-evbarm/48816: Compile fix for src/sys/arch/arm/broadcom/bcm2835_gpio.c



>Number:         48816
>Category:       port-evbarm
>Synopsis:       Compile fix for src/sys/arch/arm/broadcom/bcm2835_gpio.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-evbarm-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 17 22:50:00 +0000 2014
>Originator:     David H. Gutteridge
>Release:        HEAD sources as of May 17, 2014
>Organization:
>Environment:
(As above.)
>Description:
While compiling a new kernel for my Raspberry Pi, I encountered this
build failure:

--- bcm2835_gpio.o ---
/usr/builds/netbsd-current/src/sys/arch/arm/broadcom/bcm2835_gpio.c: In 
function 'bcmgpio_attach':
/usr/builds/netbsd-current/src/sys/arch/arm/broadcom/bcm2835_gpio.c:116:3: 
error: 'maxpin' undeclared (first use in this function)
   maxpin = 53;
   ^
/usr/builds/netbsd-current/src/sys/arch/arm/broadcom/bcm2835_gpio.c:116:3: 
note: each undeclared identifier is reported only once for each function it 
appears in
/usr/builds/netbsd-current/src/sys/arch/arm/broadcom/bcm2835_gpio.c:117:3: 
error: 'minpin' undeclared (first use in this function)
   minpin = 32;
   ^
*** [bcm2835_gpio.o] Error code 1

The fix is trivial (attached below).
>How-To-Repeat:
Attempt to compile a kernel without NGPIO defined.
>Fix:
--- bcm2835_gpio.c.orig 2014-04-22 14:51:35.000000000 -0400
+++ bcm2835_gpio.c      2014-05-17 18:43:53.000000000 -0400
@@ -100,8 +100,9 @@
 bcmgpio_attach(device_t parent, device_t self, void *aux)
 {
        struct bcmgpio_softc * const sc = device_private(self);
+       int minpin, maxpin;
 #if NGPIO > 0
-       int pin, minpin, maxpin;
+       int pin;
        u_int func;
        struct gpiobus_attach_args gba;
 #endif



Home | Main Index | Thread Index | Old Index