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] [day] [month] [year] [list]
Message-ID: <20080530120652.GA1286@polina.dev.rtsoft.ru>
Date:	Fri, 30 May 2008 16:06:52 +0400
From:	Anton Vorontsov <avorontsov@...mvista.com>
To:	David Brownell <david-b@...bell.net>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gpio: fix build errors for drivers not strictly
	requiring GPIOs

On Thu, May 29, 2008 at 08:28:10PM -0700, David Brownell wrote:
> On Tuesday 27 May 2008, Anton Vorontsov wrote:
> > Since commit 7560fa60fcdcdb0da662f6a9fad9064b554ef46c (gpio: <linux/gpio.h>
> > and "no GPIO support here" stubs) drivers can use GPIOs if they're available,
> > but don't require them.
> > 
> > This patch actually enables this feature, otherwise drivers will stumble
> > against this:
> > 
> > include/asm-generic/gpio.h:111: error: redefinition of 'gpio_is_valid'
> > include/linux/gpio.h:21: error: previous definition of 'gpio_is_valid' was here
> 
> This looks to me like pure user error ... what was anyone doing
> including <asm-generic/gpio.h> in that way?  There are a *lot* of
> bogus include combinations, and we don't try to "fix" them.

This is true, partially. I saw these errors for the drivers using
linux/of_gpio.h, it includes asm/gpio.h, which includes
asm-generic/gpio.h (I submitted of_gpio.h patch before linux/gpio.h work,
though git log might say otherwise). And yes, I should fix of_gpio.h too.

The thing is, I always thought that it is _good_ practice for the nested
headers to declare/define things conditionally by themselves. That way
you'll not have to fix all combinations, everything will (should) just
work. I.e.

#include <linux/of_gpio.h>
#include <asm-generic/gpio.h>
#include <asm/gpio.h>
#include <linux/gpio.h>

^^ This insanity will work.

Though with current headers, you'll easily catch the bogus users of
the asm/gpio.h thus will discipline the users, that might be a plus
too... ;-)

-- 
Anton Vorontsov
email: cbouatmailru@...il.com
irc://irc.freenode.net/bd2
--
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