Re: [PATCH v3] memcg: clean up networking headers file inclusion

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

 



On Fri, 14 Sep 2012 14:08:49 +0200
Michal Hocko <mhocko@xxxxxxx> wrote:

> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -50,8 +50,12 @@
>  #include <linux/cpu.h>
>  #include <linux/oom.h>
>  #include "internal.h"
> +
> +#if defined(CONFIG_MEMCG_KMEM) && defined(CONFIG_INET)
>  #include <net/sock.h>
> +#include <net/ip.h>
>  #include <net/tcp_memcontrol.h>
> +#endif

That wasn't a cleanup!

Why not just unconditionally include them?  That will impact compile
time a teeny bit, but the code is cleaner.

And it's safer, too - conditionally including header files make it more
likely that people will accidentally break the build by not testing all
relevant CONFIG_foo combinations.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]