* [Qemu-devel] [PATCH] ppc/mmu-hash64: Remove duplicated #include statement
@ 2016-07-14 8:14 Thomas Huth
2016-07-14 14:32 ` Eric Blake
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Huth @ 2016-07-14 8:14 UTC (permalink / raw)
To: qemu-ppc, david; +Cc: qemu-devel
No need to include error-report.h twice here.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
target-ppc/mmu-hash64.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/target-ppc/mmu-hash64.c b/target-ppc/mmu-hash64.c
index 82c2186..f6ffe35 100644
--- a/target-ppc/mmu-hash64.c
+++ b/target-ppc/mmu-hash64.c
@@ -24,7 +24,6 @@
#include "exec/helper-proto.h"
#include "qemu/error-report.h"
#include "sysemu/kvm.h"
-#include "qemu/error-report.h"
#include "kvm_ppc.h"
#include "mmu-hash64.h"
#include "exec/log.h"
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] ppc/mmu-hash64: Remove duplicated #include statement
2016-07-14 8:14 [Qemu-devel] [PATCH] ppc/mmu-hash64: Remove duplicated #include statement Thomas Huth
@ 2016-07-14 14:32 ` Eric Blake
2016-07-14 15:11 ` Thomas Huth
2016-07-14 16:32 ` Markus Armbruster
0 siblings, 2 replies; 4+ messages in thread
From: Eric Blake @ 2016-07-14 14:32 UTC (permalink / raw)
To: Thomas Huth, qemu-ppc, david; +Cc: qemu-devel, Markus Armbruster
[-- Attachment #1: Type: text/plain, Size: 869 bytes --]
On 07/14/2016 02:14 AM, Thomas Huth wrote:
> No need to include error-report.h twice here.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> target-ppc/mmu-hash64.c | 1 -
> 1 file changed, 1 deletion(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
Markus, do your header cleanup scripts detect any other situations like
this?
>
> diff --git a/target-ppc/mmu-hash64.c b/target-ppc/mmu-hash64.c
> index 82c2186..f6ffe35 100644
> --- a/target-ppc/mmu-hash64.c
> +++ b/target-ppc/mmu-hash64.c
> @@ -24,7 +24,6 @@
> #include "exec/helper-proto.h"
> #include "qemu/error-report.h"
> #include "sysemu/kvm.h"
> -#include "qemu/error-report.h"
> #include "kvm_ppc.h"
> #include "mmu-hash64.h"
> #include "exec/log.h"
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] ppc/mmu-hash64: Remove duplicated #include statement
2016-07-14 14:32 ` Eric Blake
@ 2016-07-14 15:11 ` Thomas Huth
2016-07-14 16:32 ` Markus Armbruster
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2016-07-14 15:11 UTC (permalink / raw)
To: Eric Blake, qemu-ppc, david; +Cc: qemu-devel, Markus Armbruster
[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]
On 14.07.2016 16:32, Eric Blake wrote:
> On 07/14/2016 02:14 AM, Thomas Huth wrote:
>> No need to include error-report.h twice here.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>> target-ppc/mmu-hash64.c | 1 -
>> 1 file changed, 1 deletion(-)
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
>
> Markus, do your header cleanup scripts detect any other situations like
> this?
There are indeed other files that include headers twice. You can get an
inaccurate list with following shell magic:
for i in `find include/ -name \*.h` ; do \
grep -r '#include.*'`echo -n $i | sed s,include/,,` * \
| sed s/:.*$// | sort > /tmp/dups1.txt ; \
sort -u </tmp/dups1.txt >/tmp/dups2.txt; \
DIF=`diff /tmp/dups?.txt | grep '\.[ch]' | tr \< \-` ; \
if [ "x$DIF" != x ] ; then \
echo '***' $i '***': ; echo $DIF ; echo; \
fi ; \
done
Note that there are also valid cases where a file is including a header
multiple times (e.g. the way include/exec/cpu_ldst.h is including
cpu_ldst_template.h multiple times), so there are also false-positives
in this list.
But for the others ... feel free to send some patches ;-)
Thomas
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] ppc/mmu-hash64: Remove duplicated #include statement
2016-07-14 14:32 ` Eric Blake
2016-07-14 15:11 ` Thomas Huth
@ 2016-07-14 16:32 ` Markus Armbruster
1 sibling, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2016-07-14 16:32 UTC (permalink / raw)
To: Eric Blake; +Cc: Thomas Huth, qemu-ppc, david, qemu-devel
Eric Blake <eblake@redhat.com> writes:
> On 07/14/2016 02:14 AM, Thomas Huth wrote:
>> No need to include error-report.h twice here.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>> target-ppc/mmu-hash64.c | 1 -
>> 1 file changed, 1 deletion(-)
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
>
> Markus, do your header cleanup scripts detect any other situations like
> this?
Not yet.
Here's how I'd eliminate double inclusion. Step 1: make our own headers
includable in any order. Step 2: include them in alphabetical order.
The duplicates become obvious, and get dropped. Step 3: tell the lazy
bums adding includes in the wrong place to mend their ways.
I'm knee-deep in step 1.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-07-14 16:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-14 8:14 [Qemu-devel] [PATCH] ppc/mmu-hash64: Remove duplicated #include statement Thomas Huth
2016-07-14 14:32 ` Eric Blake
2016-07-14 15:11 ` Thomas Huth
2016-07-14 16:32 ` Markus Armbruster
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).