2007-08-19 22:17:57

by Joe Perches

[permalink] [raw]
Subject: convert #include "linux/..." to #include <linux/...> [PATCH]s follow

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


2007-08-19 22:20:27

by Jesper Juhl

[permalink] [raw]
Subject: Re: convert #include "linux/..." to #include <linux/...> [PATCH]s follow

On 20/08/07, Joe Perches <[email protected]> wrote:
> 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)?

--
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

2007-08-19 22:33:31

by Jan Engelhardt

[permalink] [raw]
Subject: Re: convert #include "linux/..." to #include <linux/...> [PATCH]s follow


On Aug 19 2007 15:17, Joe Perches wrote:
>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
--

2007-08-19 22:44:37

by Al Viro

[permalink] [raw]
Subject: Re: convert #include "linux/..." to #include <linux/...> [PATCH]s follow

On Mon, Aug 20, 2007 at 12:33:21AM +0200, Jan Engelhardt wrote:
>
> On Aug 19 2007 15:17, Joe Perches wrote:
> >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)...

2007-08-19 22:49:37

by Joe Perches

[permalink] [raw]
Subject: Re: convert #include "linux/..." to #include <linux/...> [PATCH]s follow

On Sun, 2007-08-19 at 23:44 +0100, Al Viro wrote:
> 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

2007-08-19 22:58:46

by Al Viro

[permalink] [raw]
Subject: Re: convert #include "linux/..." to #include <linux/...> [PATCH]s follow

On Sun, Aug 19, 2007 at 03:49:16PM -0700, Joe Perches wrote:
> On Sun, 2007-08-19 at 23:44 +0100, Al Viro wrote:
> > 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...

2007-08-19 23:05:37

by Joe Perches

[permalink] [raw]
Subject: Re: convert #include "linux/..." to #include <linux/...> [PATCH]s follow

On Mon, 2007-08-20 at 00:33 +0200, Jan Engelhardt wrote:
> 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>

?