From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuOHa-0002CF-Gp for qemu-devel@nongnu.org; Mon, 18 May 2015 12:52:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuOHX-0001bn-QQ for qemu-devel@nongnu.org; Mon, 18 May 2015 12:52:50 -0400 Received: from cantor2.suse.de ([195.135.220.15]:57926 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuOHX-0001bW-KA for qemu-devel@nongnu.org; Mon, 18 May 2015 12:52:47 -0400 Message-ID: <555A18D4.4080801@suse.de> Date: Mon, 18 May 2015 18:52:36 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1eddf7c8960c0082d7db599ff3486224a3e6635d.1431891113.git.crosthwaite.peter@gmail.com> <555A0F90.1060603@twiddle.net> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/2] monitor: Split mon_get_cpu fn to remove ENV_GET_CPU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite , Richard Henderson Cc: Peter Crosthwaite , Markus Armbruster , "qemu-devel@nongnu.org Developers" , Luiz Capitulino , Peter Crosthwaite , Paolo Bonzini Am 18.05.2015 um 18:44 schrieb Peter Crosthwaite: > On Mon, May 18, 2015 at 9:13 AM, Richard Henderson wr= ote: >> On 05/17/2015 12:51 PM, Peter Crosthwaite wrote: >>> @@ -1208,7 +1203,6 @@ static void monitor_printc(Monitor *mon, int c) >>> static void memory_dump(Monitor *mon, int count, int format, int wsi= ze, >>> hwaddr addr, int is_physical) >>> { >>> - CPUArchState *env; >>> int l, line_size, i, max_digits, len; >>> uint8_t buf[16]; >>> uint64_t v; >>> @@ -1216,8 +1210,8 @@ static void memory_dump(Monitor *mon, int count= , int format, int wsize, >>> if (format =3D=3D 'i') { >>> int flags; >>> flags =3D 0; >>> - env =3D mon_get_cpu(); >>> #ifdef TARGET_I386 >>> + CPUArchState *env =3D mon_get_env(); >>> if (wsize =3D=3D 2) { >> >> C99 declaration after statement. I forget if we care or not? We care, but we haven't strictly enforced it everywhere. > Generally we do, but I have seen incidences of the notable exception > of conditionally compiled code. Otherwise would need two complicated > sets of #ifdef. >=20 > Unfortunately we can't just unconditionally define it anymore, as the > hunk below removes the only unconditional usage throwing an "unused" > werror. >=20 >> Anyway, fixable by changing the line above to >> >> int flags =3D 0; >> >=20 > I'll just make this change. If this is supposed to go through qom-cpu, I could do that change myself. The alternative would've been #if defined(TARGET_foo) || defined(TARGET_bar) ... #endif for the declaration. I was rather wondering whether mon_get_env() should be ameliorated to mon_get_cpu_env() for clarity? env is just short for environment. Otherwise modulo the above nit, Reviewed-by: Andreas F=C3=A4rber Regards, Andreas >> Otherwise, >> >> Reviewed-by: Richard Henderson >=20 > Thanks. >=20 > Regards, > Peter --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Felix Imend=C3=B6rffer, Jane Smithard, Dilip Upmanyu, Graham Norton; = HRB 21284 (AG N=C3=BCrnberg)