Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[PATCH] vlynq: remove duplicated #include

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


florian at openwrt

Jul 7, 2009, 2:36 PM

Post #1 of 5 (107 views)
Permalink
[PATCH] vlynq: remove duplicated #include

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

Signed-off-by: Huang Weiyi <weiyi.huang[at]gmail.com>
Signed-off-by: Florian Fainelli <florian[at]openwrt.org>
---
diff --git a/drivers/vlynq/vlynq.c b/drivers/vlynq/vlynq.c
index f05d2a3..ba3d71f 100644
--- a/drivers/vlynq/vlynq.c
+++ b/drivers/vlynq/vlynq.c
@@ -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>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo[at]vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


hannes at hanneseder

Jul 7, 2009, 4:54 PM

Post #2 of 5 (98 views)
Permalink
Re: [PATCH] vlynq: remove duplicated #include [In reply to]

On Tue, Jul 7, 2009 at 23:36, Florian Fainelli<florian[at]openwrt.org> wrote:
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo[at]vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


florian at openwrt

Jul 7, 2009, 11:40 PM

Post #3 of 5 (89 views)
Permalink
Re: [PATCH] vlynq: remove duplicated #include [In reply to]

Hi Hannes,

Le Wednesday 08 July 2009 01:54:14 Hannes Eder, vous avez écrit :
> On Tue, Jul 7, 2009 at 23:36, Florian Fainelli<florian[at]openwrt.org> wrote:
> > 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?

I will not, at least not now, but Huang (CC'd) might be interested.
--
Best regards, Florian Fainelli
Email : florian[at]openwrt.org
http://openwrt.org
-------------------------------
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo[at]vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


rpjday at crashcourse

Jul 8, 2009, 4:50 AM

Post #4 of 5 (88 views)
Permalink
Re: [PATCH] vlynq: remove duplicated #include [In reply to]

On Wed, 8 Jul 2009, Florian Fainelli wrote:

> Hi Hannes,
>
> Le Wednesday 08 July 2009 01:54:14 Hannes Eder, vous avez écrit :
> > On Tue, Jul 7, 2009 at 23:36, Florian Fainelli<florian[at]openwrt.org> wrote:
> > > 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?
>
> 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
========================================================================


hannes at hanneseder

Jul 8, 2009, 5:28 AM

Post #5 of 5 (88 views)
Permalink
Re: [PATCH] vlynq: remove duplicated #include [In reply to]

On Wed, Jul 8, 2009 at 13:50, Robert P. J. Day<rpjday[at]crashcourse.ca> wrote:
> On Wed, 8 Jul 2009, Florian Fainelli wrote:
>
>> Hi Hannes,
>>
>> Le Wednesday 08 July 2009 01:54:14 Hannes Eder, vous avez écrit :
>> > On Tue, Jul 7, 2009 at 23:36, Florian Fainelli<florian[at]openwrt.org> wrote:
>> > > 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?
>>
>> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo[at]vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.