Re: PATCH i-g-t Fix a clang compile error.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks, please see the attachment for the updated patch. I also put it into plain mail.

---
 debugger/eudb.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/debugger/eudb.c b/debugger/eudb.c
index 0e810db..451f284 100644
--- a/debugger/eudb.c
+++ b/debugger/eudb.c
@@ -207,15 +207,11 @@ wait_for_attn(int timeout, int *out_bits) {
 #define eu_tid(bit) eu_info->debuggees[bit].tid
 static struct eu_state *
 find_eu_shmem(int bit, volatile uint8_t *buf) {
-       struct per_thread_data {
-               uint8_t ____[dh.per_thread_scratch];
-       }__attribute__((packed)) *data;
        struct eu_state *eu;
        int mem_tid, mem_euid, i;

-       data = "" per_thread_data *)buf;
        for(i = 0; i < eu_info->num_threads; i++) {
-               eu = (struct eu_state *)&data[i];
+               eu = (struct eu_state *)&buf[i * dh.per_thread_scratch];
                mem_tid = eu->sr0 & 0x7;
                mem_euid = (eu->sr0 >> 8) & 0xf;
                if (mem_tid == eu_tid(bit) && mem_euid == eu_id(bit))
-- 
2.2.0.rc0.207.ga3a616c


On Mon, Apr 27, 2015 at 11:48 AM, Dave Gordon <david.s.gordon@xxxxxxxxx> wrote:
On 23/04/15 17:54, Yunlian Jiang wrote:
> The bug entry is at
> https://code.google.com/p/chromium/issues/detail?id=476001
>
> The patch below makes clang happy.
>
>  debugger/eudb.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/debugger/eudb.c b/debugger/eudb.c
> index 0e810db..7188a4f 100644
> --- a/debugger/eudb.c
> +++ b/debugger/eudb.c
> @@ -207,15 +207,11 @@ wait_for_attn(int timeout, int *out_bits) {
>  #define eu_tid(bit) eu_info->debuggees[bit].tid
>  static struct eu_state *
>  find_eu_shmem(int bit, volatile uint8_t *buf) {
> -       struct per_thread_data {
> -               uint8_t ____[dh.per_thread_scratch];
> -       }__attribute__((packed)) *data;
>         struct eu_state *eu;
>         int mem_tid, mem_euid, i;
>
> -       data = "" per_thread_data *)buf;
>         for(i = 0; i < eu_info->num_threads; i++) {
> -               eu = (struct eu_state *)&data[i];
> +               eu = (struct eu_state *)&buff[i*dh.per_thread_scratch];

"buff" here vs. "buf" elsewhere - is that a typo?

.Dave.

>                 mem_tid = eu->sr0 & 0x7;
>                 mem_euid = (eu->sr0 >> 8) & 0xf;
>                 if (mem_tid == eu_tid(bit) && mem_euid == eu_id(bit))
>
>
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>


From d5c4476fdbe7e9bf538c6f85b3764c902089f8b1 Mon Sep 17 00:00:00 2001
From: Yunlian Jiang <yunlian@xxxxxxxxxx>
Date: Mon, 27 Apr 2015 12:45:09 -0700
Subject: [PATCH] Remove struct per_thread_data to make it compile with clang.

The bug enty is https://code.google.com/p/chromium/issues/detail?id=476001
This patch makes clang happy.

Cc:Benjamin Widawsky <benjamin.widawsky at intel.com>
Cc:Thomas Wood <thomas.wood at intel.com>
Signed-off-by: Yunlian Jiang <yunlian at chromium.org>
---
 debugger/eudb.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/debugger/eudb.c b/debugger/eudb.c
index 0e810db..451f284 100644
--- a/debugger/eudb.c
+++ b/debugger/eudb.c
@@ -207,15 +207,11 @@ wait_for_attn(int timeout, int *out_bits) {
 #define eu_tid(bit) eu_info->debuggees[bit].tid
 static struct eu_state *
 find_eu_shmem(int bit, volatile uint8_t *buf) {
-	struct per_thread_data {
-		uint8_t ____[dh.per_thread_scratch];
-	}__attribute__((packed)) *data;
 	struct eu_state *eu;
 	int mem_tid, mem_euid, i;
 
-	data = (struct per_thread_data *)buf;
 	for(i = 0; i < eu_info->num_threads; i++) {
-		eu = (struct eu_state *)&data[i];
+		eu = (struct eu_state *)&buf[i * dh.per_thread_scratch];
 		mem_tid = eu->sr0 & 0x7;
 		mem_euid = (eu->sr0 >> 8) & 0xf;
 		if (mem_tid == eu_tid(bit) && mem_euid == eu_id(bit))
-- 
2.2.0.rc0.207.ga3a616c

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux