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]
Date:	Tue, 23 Feb 2010 07:59:53 +0100
From:	Borislav Petkov <petkovbb@...glemail.com>
To:	viresh kumar <viresh.linux@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: QUERY: Inclusion of header files in kernel header files

From: viresh kumar <viresh.linux@...il.com>
Date: Tue, Feb 23, 2010 at 12:13:35PM +0530

Hi,

> I have been through many kernel header files and have found that kernel header
> files at many places don't include other header files which they have
> dependency upon.
> 
> For example:
> <linux/amba/bus.h> uses struct device and struct resource and it doesn't
> include <linux/device.h> and <linux/resource.h> header files.
> 
> Now, whenever i try to include bus.h, i have to include device.h and resource.h.
> 
> Is this correct approach?
> 
> Again, if i include device.h and resource.h, they must be included before bus.h.

and this is the thing: all those other files which include
<linux/amba/bus.h> either include <linux/device.h> and
<linux/resource.h> directly or the last are being included indirectly
through other headers.

Baseline, struct device and struct resource's definitions have to be
available before <linux/amba/bus.h> is included. That's why you have to
include the bus.h header last.

> Now this will disturb the alphabetical ordering of including header files
> sometimes. (not in this example)

I don't think there's such thing as alphabetical header ordering and if
it were it would be rather dumb thing to do.

Hope this helps.

-- 
Regards/Gruss,
    Boris.
--
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