From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk981-0004hC-M2 for qemu-devel@nongnu.org; Tue, 13 May 2014 05:36:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wk97x-0007y5-2z for qemu-devel@nongnu.org; Tue, 13 May 2014 05:36:05 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:32970 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk97w-0007xi-N6 for qemu-devel@nongnu.org; Tue, 13 May 2014 05:36:01 -0400 References: <1399938424-6703-1-git-send-email-rth@twiddle.net> <1399938424-6703-8-git-send-email-rth@twiddle.net> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <1399938424-6703-8-git-send-email-rth@twiddle.net> Date: Tue, 13 May 2014 10:36:09 +0100 Message-ID: <87zjim6mwm.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 07/10] tcg: Register the helper info struct rather than the name List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, aurelien@aurel32.net Richard Henderson writes: > This will let us find all the info from the hash table. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée > --- > tcg/tcg.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/tcg/tcg.c b/tcg/tcg.c > index b64471f..3bbf982 100644 > --- a/tcg/tcg.c > +++ b/tcg/tcg.c > @@ -356,7 +356,7 @@ void tcg_context_init(TCGContext *s) > > for (i = 0; i < ARRAY_SIZE(all_helpers); ++i) { > g_hash_table_insert(helper_table, (gpointer)all_helpers[i].func, > - (gpointer)all_helpers[i].name); > + (gpointer)&all_helpers[i]); > } > > tcg_target_init(s); > @@ -1149,7 +1149,10 @@ static inline const char *tcg_find_helper(TCGContext *s, uintptr_t val) > { > const char *ret = NULL; > if (s->helpers) { > - ret = g_hash_table_lookup(s->helpers, (gpointer)val); > + TCGHelperInfo *info = g_hash_table_lookup(s->helpers, (gpointer)val); > + if (info) { > + ret = info->name; > + } > } > return ret; > } -- Alex Bennée