lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <28714.1308307859@redhat.com>
Date:	Fri, 17 Jun 2011 11:50:59 +0100
From:	David Howells <dhowells@...hat.com>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	dhowells@...hat.com, linux-kernel@...r.kernel.org,
	grant@...retlab.ca, ralf@...ux-mips.org
Subject: Re: [PATCH] FRV: Hook up gpiolib support

Mark Brown <broonie@...nsource.wolfsonmicro.com> wrote:

> And to repeat what I said: the generic header prototypes everything it
> needs before it uses it so there should be no problem here, it's not
> been a problem on the other architectures using this code verbatim.
> Please be more specific.

Okay:

  CC      drivers/mtd/maps/gpio-addr-flash.o
In file included from /data/frv/linux-2.6-frv/arch/frv/include/asm/gpio.h:21,
                 from include/linux/gpio.h:8,
                 from drivers/mtd/maps/gpio-addr-flash.c:17:
include/asm-generic/gpio.h: In function 'gpio_get_value_cansleep':
include/asm-generic/gpio.h:233: error: implicit declaration of function 'gpio_get_value'
include/asm-generic/gpio.h: In function 'gpio_set_value_cansleep':
include/asm-generic/gpio.h:239: error: implicit declaration of function 'gpio_set_value'
drivers/mtd/maps/gpio-addr-flash.c: In function 'gpio_flash_probe':
drivers/mtd/maps/gpio-addr-flash.c:234: error: implicit declaration of function 'gpio_request'
drivers/mtd/maps/gpio-addr-flash.c:238: error: implicit declaration of function 'gpio_free'
drivers/mtd/maps/gpio-addr-flash.c:242: error: implicit declaration of function 'gpio_direction_output'


Let me expand on my explanation earlier:

 (1) asm-generic/gpio.h has an _inline_ function:

	static inline int gpio_get_value_cansleep(unsigned gpio)
	{
		might_sleep();
		return gpio_get_value(gpio);
	}

 (2) gpio_get_value() is implemented in asm/gpio.h.  It is not declared in
     asm-generic/gpio.h.

 (3) Therefore, the #inclusion of asm-generic/gpio.h must come _after_ the
     implementation of gpio_get_value() in asm/gpio.h.

 (4) asm/gpio.h implements the aforementioned inline function:

	static inline int gpio_get_value(unsigned int gpio)
	{
		return __gpio_get_value(gpio);
	}

 (5) __gpio_get_value() is declared in asm-generic/gpio.h.  It is not declared
     in asm/gpio.h.

 (6) Therefore, the #inclusion of asm/gpio.h must come _before_ the
     implementation of gpio_get_value() in asm/gpio.h.

Thus (3) and (6) contradict.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ