Skip to contentSkip to conversation

convert #include "linux/..." to #include <linux/...> [PATCH]s follow

DISCUSSION Joe Perches 4 participants 7 messages Aug 19, 2007 Kernel janitors

lore
Share & tools
lore
#0 lore raw

There are several files that:

#include "linux/file" not #include <linux/file>
#include "asm/file" not #include <asm/file>

Here's a little script that converts them:

egrep -i -r -l --include=*.[ch] \
"^[[:space:]]*\#[[:space:]]*include[[:space:]]*\"(linux|asm)/(.*)\"" * \
| xargs sed -i -e 's/^[[:space:]]*#[[:space:]]*include[[:space:]]*"\(linux\|asm\)\/\(.*\)"/#include <\1\/\2>/g'

Maybe a similar check could be added to checkpatch.pl

#1 lore raw
Quoted 7 lines · Joe Perches

There are several files that:

#include "linux/file" not #include <linux/file>
#include "asm/file" not #include <asm/file>

Here's a little script that converts them:

If you've actually checked that such conversions are correct and work fine, how about a patch (or patches)?

Signature · 3 lines
Jesper Juhl <[email protected]>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html
#2 lore raw
In reply to Joe Perches
Quoted 4 lines · Joe Perches

There are several files that:

#include "linux/file" not #include <linux/file>
#include "asm/file" not #include <asm/file>

Not only that. All directories in include should be checked against (e.g. <net/*>)

Jan

#3 lore raw
Quoted 9 lines · Jan Engelhardt
Quoted 4 lines · Joe Perches

There are several files that:

#include "linux/file" not #include <linux/file>
#include "asm/file" not #include <asm/file>

Not only that. All directories in include should be checked against (e.g. <net/*>)

Except that some instances are legitimate (e.g. there was a bunch in arch/um, IIRC)...

#4 lore raw
Quoted 2 lines · Al Viro

Except that some instances are legitimate (e.g. there was a bunch in arch/um, IIRC)...

I guess it's a good thing that vger seems to have rejected that 140KB patch I sent against arch/um and include/asm-um.

cheers, Joe

#5 lore raw
Quoted 6 lines · Joe Perches
Quoted 2 lines · Al Viro

Except that some instances are legitimate (e.g. there was a bunch in arch/um, IIRC)...

I guess it's a good thing that vger seems to have rejected that 140KB patch I sent against arch/um and include/asm-um.

It would be a better thing if you
* did builds of the patched trees (allmodconfig for uml/i386 and
uml/amd64 in this case)
* figured out that one can send a reference to branch in git tree
(with summary/shortlog/diffstat) using somewhat less than 140KB...

#6 lore raw
In reply to Jan Engelhardt
Quoted 2 lines · Jan Engelhardt

Not only that. All directories in include should be checked against (e.g. <net/*>)

Should any file in include/ have a line like:

	#include "[path/]file"

Shouldn't these all be

	#include <path/file>

?