Re: [Intel-gfx] [PATCH i-g-t] tools/aubdump: Fix ISO C90 forbids mixed declarations and code warning

2018-04-09 Thread Scott D Phillips
Tvrtko Ursulin  writes:

> From: Tvrtko Ursulin 
>
> Back to a clean build with no warnings, at least for me.

Why c90? If that's the language we mean to target then we should
probably add it to the build system so people with gcc 5.1 and later
will see the warnings too. fwiw, my build with clang 6 gives a couple
dozen warnings.

> Signed-off-by: Tvrtko Ursulin 
> Cc: Jordan Justen 
> Cc: Scott D Phillips 
> ---
>  tools/aubdump.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tools/aubdump.c b/tools/aubdump.c
> index 267061b0fc2b..2d2b6c607a43 100644
> --- a/tools/aubdump.c
> +++ b/tools/aubdump.c
> @@ -394,10 +394,11 @@ gen8_emit_ggtt_pte_for_range(uint64_t start, uint64_t 
> end)
>  
>   entry_addr = start & ~(4096 - 1);
>   do {
> + uint64_t last_page_entry, num_entries;
> +
>   page_num = entry_addr >> 21;
> - uint64_t last_page_entry =
> - min((page_num + 1) << 21, end_aligned);
> - uint64_t num_entries = (last_page_entry - entry_addr) >> 12;
> + last_page_entry = min((page_num + 1) << 21, end_aligned);
> + num_entries = (last_page_entry - entry_addr) >> 12;
>   mem_trace_memory_write_header_out(
>   entry_addr >> 9, num_entries * GEN8_PTE_SIZE,
>   AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_GGTT_ENTRY);
> -- 
> 2.14.1
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t] tools/aubdump: Fix ISO C90 forbids mixed declarations and code warning

2018-04-09 Thread Tvrtko Ursulin
From: Tvrtko Ursulin 

Back to a clean build with no warnings, at least for me.

Signed-off-by: Tvrtko Ursulin 
Cc: Jordan Justen 
Cc: Scott D Phillips 
---
 tools/aubdump.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/aubdump.c b/tools/aubdump.c
index 267061b0fc2b..2d2b6c607a43 100644
--- a/tools/aubdump.c
+++ b/tools/aubdump.c
@@ -394,10 +394,11 @@ gen8_emit_ggtt_pte_for_range(uint64_t start, uint64_t end)
 
entry_addr = start & ~(4096 - 1);
do {
+   uint64_t last_page_entry, num_entries;
+
page_num = entry_addr >> 21;
-   uint64_t last_page_entry =
-   min((page_num + 1) << 21, end_aligned);
-   uint64_t num_entries = (last_page_entry - entry_addr) >> 12;
+   last_page_entry = min((page_num + 1) << 21, end_aligned);
+   num_entries = (last_page_entry - entry_addr) >> 12;
mem_trace_memory_write_header_out(
entry_addr >> 9, num_entries * GEN8_PTE_SIZE,
AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_GGTT_ENTRY);
-- 
2.14.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx