From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR01c-0008Rd-91 for qemu-devel@nongnu.org; Wed, 03 Feb 2016 11:11:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aR01Y-0001gp-4O for qemu-devel@nongnu.org; Wed, 03 Feb 2016 11:11:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR01X-0001gV-Js for qemu-devel@nongnu.org; Wed, 03 Feb 2016 11:11:20 -0500 References: <1454494453-20738-1-git-send-email-glaubitz@physik.fu-berlin.de> <1454494453-20738-2-git-send-email-glaubitz@physik.fu-berlin.de> <56B219E4.2070800@redhat.com> <56B21ACC.1020802@physik.fu-berlin.de> From: Eric Blake Message-ID: <56B226A5.80507@redhat.com> Date: Wed, 3 Feb 2016 09:11:17 -0700 MIME-Version: 1.0 In-Reply-To: <56B21ACC.1020802@physik.fu-berlin.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="md8vQj4MqHtRUJFbShPKJ1aGnMgsXVPpo" Subject: Re: [Qemu-devel] [PATCH] m68k: Build the opcode table only once to avoid multithreading issues List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Paul Adrian Glaubitz , qemu-devel@nongnu.org Cc: laurent@vivier.eu This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --md8vQj4MqHtRUJFbShPKJ1aGnMgsXVPpo Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/03/2016 08:20 AM, John Paul Adrian Glaubitz wrote: > On 02/03/2016 04:16 PM, Eric Blake wrote: >> Missing {}. Are you sure this is the version that passed >> checkpatch.pl? >=20 > Yes: >=20 > glaubitz@z6:..qemu/target-m68k> ../scripts/checkpatch.pl > 0002-m68k-Build-the-opcode-table-only-once-to-avoid-multi.patch > total: 0 errors, 0 warnings, 10 lines checked >=20 > 0002-m68k-Build-the-opcode-table-only-once-to-avoid-multi.patch has no > obvious style problems and is ready for submission. > glaubitz@z6:..qemu/target-m68k> cat > 0002-m68k-Build-the-opcode-table-only-once-to-avoid-multi.patch > From 2d8ef8d0244db95e41e04ff909560f12676e1dec Mon Sep 17 00:00:00 2001 > From: John Paul Adrian Glaubitz > Date: Wed, 3 Feb 2016 10:22:35 +0100 > Subject: [PATCH 2/2] m68k: Build the opcode table only once to avoid > multithreading issues Weird. Wonder why it doesn't complain on that file? I'm guessing that it is due to the #define on the next line. Because rearranging things to put the code after the #define changes the situation (but not the semantics): diff --git i/target-m68k/translate.c w/target-m68k/translate.c index 342c040..587c44f 100644 --- i/target-m68k/translate.c +++ w/target-m68k/translate.c @@ -2832,6 +2832,10 @@ void register_m68k_insns (CPUM68KState *env) if (m68k_feature(env, M68K_FEATURE_##feature)) \ register_opcode(disas_##name, 0x##opcode, 0x##mask); \ } while(0) + + if (0) + return; + INSN(undef, 0000, 0000, CF_ISA_A); INSN(arith_im, 0080, fff8, CF_ISA_A); INSN(bitrev, 00c0, fff8, CF_ISA_APLUSC); properly warns: $ git commit -a -m tmp WARNING: braces {} are necessary for all arms of this statement #10: FILE: target-m68k/translate.c:2836: + if (opcode_table[0]) [...] total: 0 errors, 1 warnings, 10 lines checked (yes, I've hooked up git to have a pre-commit check to run checkpatch.pl)= =2E --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --md8vQj4MqHtRUJFbShPKJ1aGnMgsXVPpo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWsialAAoJEKeha0olJ0Nq6JAH/1BCwPaq3ZjW607sojJOX9Lj n0HcAm7+kZYiaJdz6DwKTGGx7oq9dcH62mBfW8ETNZaeLbz3MCqzrJuwFKm+7Q3Z 3KmXON3gNfC2Nd0yOO2q0xd+EfR1yGQ1ZqFP4wnRTJTSmoZ81A0U9sUp/Lj79ShT Ew5sCY12VY/jCCmvVtjQAolyB1aJzRV9Vtjv8pusfweemGkXwjxLzsLQjVGhXAo4 gPReG8qiEJpcwKnXjCetCTnNUfvuWvUX7vtt6oPP+DFZkFZt5RwlyjpnCzYAfkXQ SM1cRS+H30nDGMir/OopeetW9uOLejj23c4yQC8Hh79XKQGyAADvkboECJsBV+o= =UBlG -----END PGP SIGNATURE----- --md8vQj4MqHtRUJFbShPKJ1aGnMgsXVPpo--