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:	Sun, 9 Jan 2011 23:33:19 +0100
From:	Christoph Paasch <christoph.paasch@...ouvain.be>
To:	Ben Hutchings <bhutchings@...arflare.com>
Cc:	Randy Dunlap <rdunlap@...otime.net>, davem@...emloft.net,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Cleanup include/net/tcp.h include-files and coding-style


On Sunday, January 09, 2011 wrote Ben Hutchings:
> The cost of repeated inclusion is minimal.  GCC's preprocessor
> recognises when the entire content of a file is conditional on #ifndef
> FOO and will not even open it again if FOO is defined.
Thanks, I did not knew about that.

> If a file directly references definitions that are supposed to be
> provided by a certain header, changing it to rely on indirect inclusion
> of that header generally does *not* aid maintenance.
But then, to be coherent, we would need to add the following includes (and I'm 
even not 100% sure if it's all we need):

linux/percpu_counter.h (needed for percpu_counter_sum_positive)
linux/mm_types.h (needed for struct page)
linux/aio.h (needed for struct kiocb)
net/inet_sock.h (needed for struct ip_options)
linux/pipe_fs_i.h (needed for struct pipe_inode_info)
linux/poll.h (needed for struct poll_table_struct)
linux/compiler.h (needed for __percpu)

IMO there should be a clear rule for the inclusion of files.

Personally I think it's best to include as few files as possible. Because I 
think, that this reduces the risk of including a file, whose structs/functions 
aren't even referenced (it's easier to manually check if one include out of 10 
is useless, than checking it for 50).

But ok, there may be other stronger reasons for the opposite.
What are the reasons for including these files?

Regards,
Christoph

--
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain

www.rollerbulls.be
--
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ