public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: apgo@patchbomb.org (Arthur Othieno)
To: Herbert Poetzl <herbert@13thfloor.at>
Cc: Andrew Morton <akpm@osdl.org>,
	Linux Kernel ML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] remove duplicate #includes
Date: Tue, 14 Feb 2006 10:50:57 -0500	[thread overview]
Message-ID: <20060214155057.GE14516@krypton> (raw)
In-Reply-To: <20060213093959.GA10496@MAIL.13thfloor.at>

On Mon, Feb 13, 2006 at 10:39:59AM +0100, Herbert Poetzl wrote:
> 
> Hi Andrew! Folks!
> 
> recently I stumbled over a few files which #include the 
> same .h file twice -- sometimes even in the immediately
> following line. so I thought I'd look into that to reduce 
> the amount of duplicate includes in the kernel ...
> 
> I first searched for 'potential' duplicates with the
> following command sequence ...
> 
>   find . -type f -name '*.[hcS]' -exec gawk '/^#include/ { X[$2]++ } END { for (n in X) if (X[n]>1) printf("%s: %s[%d]\n",FILENAME,n,X[n]); }' {} \;

scripts/checkincludes.pl ;-)

> .. then, I inspected each of the results, and if it was
> valid, I removed every but the first occurence (of course 
> only after detailed inspection)
>
> I will do a bunch of further tests with this patch to
> make absolutely 100% sure that there are no bad changes.
> the patch contains the obvious cases first, and the not
> so obvious ones at the end.

Please, please, split this into smaller, readable chunks. As is, it is
bound to break patches queued up in -mm and other subsystem trees. You
don't want the angry mob coming after you, really.

[snip]

> --- linux-2.6.16-rc2/arch/parisc/kernel/signal.c	2006-01-03 17:29:13 +0100
> +++ linux-2.6.16-rc2-mpf/arch/parisc/kernel/signal.c	2006-02-13 01:24:26 +0100
> @@ -24,7 +24,6 @@
>  #include <linux/ptrace.h>
>  #include <linux/unistd.h>
>  #include <linux/stddef.h>
> -#include <linux/compat.h>

Second occurrence is the redundant one here; include/linux/compat.h
already wrapped around #ifdef CONFIG_COMPAT ..

>  #include <linux/elf.h>
>  #include <linux/personality.h>
>  #include <asm/ucontext.h>

[snip]

> diff -NurpP --minimal linux-2.6.16-rc2/arch/powerpc/platforms/powermac/setup.c linux-2.6.16-rc2-mpf/arch/powerpc/platforms/powermac/setup.c
> --- linux-2.6.16-rc2/arch/powerpc/platforms/powermac/setup.c	2006-02-07 11:52:12 +0100
> +++ linux-2.6.16-rc2-mpf/arch/powerpc/platforms/powermac/setup.c	2006-02-13 01:35:28 +0100
> @@ -76,7 +76,6 @@
>  #include <asm/smu.h>
>  #include <asm/pmc.h>
>  #include <asm/lmb.h>
> -#include <asm/udbg.h>

You broke CONFIG_PPC_PMAC when CONFIG_PPC64=n

>  #include "pmac.h"
>  

[snip]

> diff -NurpP --minimal linux-2.6.16-rc2/drivers/char/drm/drm.h linux-2.6.16-rc2-mpf/drivers/char/drm/drm.h
> --- linux-2.6.16-rc2/drivers/char/drm/drm.h	2006-02-07 11:52:24 +0100
> +++ linux-2.6.16-rc2-mpf/drivers/char/drm/drm.h	2006-02-13 01:48:55 +0100
> @@ -51,11 +51,9 @@
>  #if defined(__FreeBSD__) && defined(IN_MODULE)
>  /* Prevent name collision when including sys/ioccom.h */
>  #undef ioctl
> -#include <sys/ioccom.h>
>  #define ioctl(a,b,c)		xf86ioctl(a,b,c)
> -#else
> -#include <sys/ioccom.h>
>  #endif				/* __FreeBSD__ && xf86ioctl */
> +#include <sys/ioccom.h>

This changes semantics, like Bastian pointed out..

>  #define DRM_IOCTL_NR(n)		((n) & 0xff)
>  #define DRM_IOC_VOID		IOC_VOID
>  #define DRM_IOC_READ		IOC_OUT

  parent reply	other threads:[~2006-02-14 15:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-13  9:39 [PATCH] remove duplicate #includes Herbert Poetzl
2006-02-13 10:26 ` Bastian Blank
2006-02-13 15:01   ` Herbert Poetzl
2006-02-14 15:50 ` Arthur Othieno [this message]
2006-02-15  9:48   ` Herbert Poetzl
2006-02-14 21:03 ` Jean Delvare
2006-02-14 21:21   ` Andrew Morton
2006-02-15  9:52     ` Herbert Poetzl
2006-02-15 10:12 ` Russell King
  -- strict thread matches above, loose matches on Subject: below --
2015-07-02 21:40 [PATCH] remove duplicate includes Matteo Croce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060214155057.GE14516@krypton \
    --to=apgo@patchbomb.org \
    --cc=akpm@osdl.org \
    --cc=herbert@13thfloor.at \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox