From: Herbert Poetzl <herbert@13thfloor.at>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel ML <linux-kernel@vger.kernel.org>,
Bastian Blank <bastian@waldi.eu.org>,
Arthur Othieno <apgo@patchbomb.org>,
Jean Delvare <khali@linux-fr.org>,
Russell King <rmk+lkml@arm.linux.org.uk>
Subject: [PATCH/RFC] remove duplicate #includes, take II
Date: Sat, 18 Feb 2006 15:55:25 +0100 [thread overview]
Message-ID: <20060218145525.GA32618@MAIL.13thfloor.at> (raw)
Andrew! Folks!
after the response to the first (cruel?) approach
here is a different one (probably as incomplete
and imperfect as the previous, but it seems that
there is a solution in reach)
this time I utilized the checkincludes.pl script
to identify and automatically remove duplicates.
this was done with the following command sequence:
find . -type f -name '*.[hcS]' \
-exec scripts/checkincludes.pl {} \; \
| gawk -F"[: ]" '
{ printf "egrep -nH \"#\\W*include\\W*<%s>\" %s\n",$3,$1 }' \
| sh \
| gawk -F: '{ X[$1]=$2; }
END { for (i in X) printf "%s %d\n",i, X[i] }' \
| gawk '{ printf "mv %s %s.orig && sed -ne \"%dd;p\" %s.orig >%s && echo %s\n",$1,$1,$2,$1,$1,$1; }' \
| sh
which basically executes checkincludes.pl on all
.c, .h and .S files, then greps for '<'*'>' type
includes (to avoid the "*" type ones, which are
usually local includes) and then removes the last
occurence of the identified include from the file
I then splitted it into three categories:
A) probably correct
B) probably wrong
C) definitely wrong
so if folks want to cherry pick and/or comment on
the first two categories, please do so, I will
collect all the feedback and produce a patch to
get rid of the duplicates later ...
best,
Herbert
next reply other threads:[~2006-02-18 14:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-18 14:55 Herbert Poetzl [this message]
2006-02-18 14:57 ` [PATCH/RFC] remove duplicate #includes, take II, A Herbert Poetzl
2006-02-18 14:58 ` [PATCH/RFC] remove duplicate #includes, take II, part B Herbert Poetzl
2006-02-19 0:19 ` Russell King
2006-02-18 14:59 ` [PATCH/RFC] remove duplicate #includes, take II, part C Herbert Poetzl
2006-02-19 23:47 ` [PATCH/RFC] remove duplicate #includes, take II Benjamin LaHaise
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=20060218145525.GA32618@MAIL.13thfloor.at \
--to=herbert@13thfloor.at \
--cc=akpm@osdl.org \
--cc=apgo@patchbomb.org \
--cc=bastian@waldi.eu.org \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+lkml@arm.linux.org.uk \
/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
Powered by JetHome