Skip to contentSkip to conversation

vlynq: remove duplicated #include

PATCH In review Florian Fainelli 3 participants 5 messages Jul 7, 2009 – Jul 8, 2009 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vlynq: remove duplicated #include

Remove duplicated #include('s) in drivers/vlynq/vlynq.c

---

drivers/vlynq/vlynq.c +0 -1
index f05d2a3..ba3d71f 100644
@@ -28,7 +28,6 @@
 #include <linux/errno.h>
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
-#include <linux/device.h>
 #include <linux/delay.h>
 #include <linux/io.h>
 
#1 lore raw
Quoted 1 line · Florian Fainelli

Remove duplicated #include('s) in drivers/vlynq/vlynq.c

The following little script catches more of these issues, though it might be a bit fragile:

#!/bin/bash
find . -name "*.c" | \
while read file; do

    dblinc=$(grep "^#include <" $file | sort | uniq -c | grep -v "^      1 ")
    [ "$dblinc" != "" ] && echo $file: $dblinc

done

when ran from the linux-2.6 src tree, the output is something like (lines starting with '#' are my annotations):

./mm/slab.c: 3 #include <linux/kmalloc_sizes.h>

# this is a false positive
./mm/slqb.c: 2 #include <linux/seq_file.h>
# I did not look a this one
./mm/shmem.c: 2 #include <linux/vfs.h>
# this is a hit
# the rest (about 50 hits) skipped

Do you want to investigate this issues?

Cheers,
Hannes

#2 lore raw

Hi Hannes,

Le Wednesday 08 July 2009 01:54:14 Hannes Eder, vous avez écrit :

Quoted 17 lines · Florian Fainelli
Quoted 1 line

Remove duplicated #include('s) in drivers/vlynq/vlynq.c

The following little script catches more of these issues, though it might be a bit fragile:

#!/bin/bash
find . -name "*.c" | \
while read file; do

    dblinc=$(grep "^#include <" $file | sort | uniq -c | grep -v "^      1

") [ "$dblinc" != "" ] && echo $file: $dblinc
done

when ran from the linux-2.6 src tree, the output is something like (lines starting with '#' are my annotations):

./mm/slab.c: 3 #include <linux/kmalloc_sizes.h>

Quoted 8 lines
# this is a false positive
./mm/slqb.c: 2 #include <linux/seq_file.h>
# I did not look a this one
./mm/shmem.c: 2 #include <linux/vfs.h>
# this is a hit
# the rest (about 50 hits) skipped

Do you want to investigate this issues?

I will not, at least not now, but Huang (CC'd) might be interested.

Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------
#3 lore raw
Quoted 27 lines · Florian Fainelli

Hi Hannes,

Le Wednesday 08 July 2009 01:54:14 Hannes Eder, vous avez écrit :

Quoted 24 lines · Florian Fainelli
Quoted 1 line

Remove duplicated #include('s) in drivers/vlynq/vlynq.c

The following little script catches more of these issues, though it might be a bit fragile:

#!/bin/bash
find . -name "*.c" | \
while read file; do

    dblinc=$(grep "^#include <" $file | sort | uniq -c | grep -v "^      1

") [ "$dblinc" != "" ] && echo $file: $dblinc
done

when ran from the linux-2.6 src tree, the output is something like (lines starting with '#' are my annotations):

./mm/slab.c: 3 #include <linux/kmalloc_sizes.h>

# this is a false positive
./mm/slqb.c: 2 #include <linux/seq_file.h>
# I did not look a this one
./mm/shmem.c: 2 #include <linux/vfs.h>
# this is a hit
# the rest (about 50 hits) skipped
Quoted 3 lines
Quoted 1 line

Do you want to investigate this issues?

I will not, at least not now, but Huang (CC'd) might be interested.

isn't "make includecheck" supposed to identify duplicated includes?
why aren't you using that?

rday
--

========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA

Linux Consulting, Training and Annoying Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Linked In:                             http://www.linkedin.com/in/rpjday
Twitter:                                       http://twitter.com/rpjday

========================================================================

#4 lore raw
Quoted 29 lines · Robert P. J. Day
Quoted 27 lines · Florian Fainelli

Hi Hannes,

Le Wednesday 08 July 2009 01:54:14 Hannes Eder, vous avez écrit :

Quoted 24 lines · Florian Fainelli
Quoted 1 line

Remove duplicated #include('s) in drivers/vlynq/vlynq.c

The following little script catches more of these issues, though it might be a bit fragile:

#!/bin/bash
find . -name "*.c" | \
while read file; do
    dblinc=$(grep "^#include <" $file | sort | uniq -c | grep -v "^      1 ") [ "$dblinc" != "" ] && echo $file: $dblinc
done

when ran from the linux-2.6 src tree, the output is something like (lines starting with '#' are my annotations):

./mm/slab.c: 3 #include <linux/kmalloc_sizes.h>

# this is a false positive
./mm/slqb.c: 2 #include <linux/seq_file.h>
# I did not look a this one
./mm/shmem.c: 2 #include <linux/vfs.h>
# this is a hit
# the rest (about 50 hits) skipped
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Do you want to investigate this issues?

I will not, at least not now, but Huang (CC'd) might be interested.

 isn't "make includecheck" supposed to identify duplicated includes? why aren't you using that?

Hey man, do not stop me from invent the wheel again, and again, and again, ... ;). You are right "make includecheck" does the trick check for duplicated includes, in it does so in a much nicer way.

Thanks,
-Hannes