Skip to contentSkip to conversation

Documentation/firmware/... convert #include "linux/..." to #include <linux/...>

PATCH In review Joe Perches 2 participants 5 messages Aug 19, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 4/5 Documentation/firmware/... convert #include "linux/..." to #include <linux/...>

(untested)

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'

This one is probably wrong.

It should likely keep firmware.h in
the same directory as firmware.c

Documentation/firmware_class/firmware_sample_driver.c +1 -1
index 6865cbe..754ded2 100644
@@ -13,7 +13,7 @@
 #include <linux/device.h>
 #include <linux/string.h>
 
-#include "linux/firmware.h"
+#include "firmware.h"
 
 static struct device ghost_device = {
 	.bus_id    = "ghost0",
#1 lore raw
Quoted 24 lines · On Sun, 19 Aug 2007 15:19:32 -0700 Joe Perches wrote:

(untested)

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'

This one is probably wrong.

It should likely keep firmware.h in
the same directory as firmware.c

Documentation/firmware_class/firmware_sample_driver.c +0 -0
index 6865cbe..754ded2 100644

Documentation/firmware_class/firmware_sample_driver.c line 16

Quoted 5 lines
Documentation/firmware_class/firmware_sample_driver.c +1 -1
@@ -13,7 +13,7 @@
 #include <linux/device.h>
 #include <linux/string.h>
 
-#include "linux/firmware.h"
+#include "firmware.h"

I believe that it should be <linux/firmware.h>.

Documentation/firmware_class/firmware_sample_driver.c line 19

Quoted 2 lines
Documentation/firmware_class/firmware_sample_driver.c +0 -0
 static struct device ghost_device = {
 	.bus_id    = "ghost0",

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#2 lore raw
Quoted 3 lines · Randy Dunlap

Documentation/firmware_class/firmware_sample_driver.c line 16

Quoted 2 lines
Documentation/firmware_class/firmware_sample_driver.c +1 -1
-#include "linux/firmware.h"
+#include "firmware.h"

I believe that it should be <linux/firmware.h>.

OK.

That's not my taste though, especially if only included by files in the firmware_class directory. Less pollution/namespace collision in include/linux

cheers, Joe

#3 lore raw
Quoted 10 lines · On Sun, 19 Aug 2007 15:31:57 -0700 Joe Perches wrote:
Quoted 3 lines · Randy Dunlap

Documentation/firmware_class/firmware_sample_driver.c line 16

Quoted 2 lines
Documentation/firmware_class/firmware_sample_driver.c +1 -1
-#include "linux/firmware.h"
+#include "firmware.h"

I believe that it should be <linux/firmware.h>.

OK.

That's not my taste though, especially if only included by files in the firmware_class directory. Less pollution/namespace collision in include/linux

It's not only included in that directory.
I find it included in 88 source files throughout the kernel tree.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#4 lore raw
Quoted 2 lines · Randy Dunlap

It's not only included in that directory.
I find it included in 88 source files throughout the kernel tree.

I see, sorry. I didn't read the file.
I thought it was a sample driver with a binary blob.

cheers, Joe

Documentation/firmware_class/firmware_sample_driver.c +1 -1
index 6865cbe..754ded2 100644
@@ -13,7 +13,7 @@
 #include <linux/device.h>
 #include <linux/string.h>
 
-#include "linux/firmware.h"
+#include <linux/firmware.h>
 
 static struct device ghost_device = {
 	.bus_id    = "ghost0",