Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kDOd3-0001ZP-Jy for mharc-qemu-trivial@gnu.org; Wed, 02 Sep 2020 05:00:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDOd2-0001Yz-An; Wed, 02 Sep 2020 05:00:28 -0400 Received: from smtpout1.mo804.mail-out.ovh.net ([79.137.123.220]:47953) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDOd0-0000Pb-L2; Wed, 02 Sep 2020 05:00:28 -0400 Received: from mxplan5.mail.ovh.net (unknown [10.109.156.136]) by mo804.mail-out.ovh.net (Postfix) with ESMTPS id 96A555D15328; Wed, 2 Sep 2020 11:00:24 +0200 (CEST) Received: from kaod.org (37.59.142.101) by DAG8EX1.mxp5.local (172.16.2.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Wed, 2 Sep 2020 11:00:23 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-101G00449756ef9-19f3-427e-b8b5-204c0705ce53, AA3809B24A0F88596FE87CA7447536A9393A4537) smtp.auth=groug@kaod.org Date: Wed, 2 Sep 2020 11:00:22 +0200 From: Greg Kurz To: Philippe =?UTF-8?B?TWF0aGlldS1EYXVkw6k=?= CC: , Laurent Vivier , Thomas Huth , Corey Minyard , "Michael S. Tsirkin" , , , "Paolo Bonzini" , David Gibson , Richard Henderson Subject: Re: [PATCH 3/5] hw/ppc/spapr: Do not declare local variable only used for assertion Message-ID: <20200902110022.6f600e03@bahia.lan> In-Reply-To: <20200902080801.160652-4-philmd@redhat.com> References: <20200902080801.160652-1-philmd@redhat.com> <20200902080801.160652-4-philmd@redhat.com> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [37.59.142.101] X-ClientProxiedBy: DAG8EX1.mxp5.local (172.16.2.71) To DAG8EX1.mxp5.local (172.16.2.71) X-Ovh-Tracer-GUID: 5b362662-7b61-4c17-a39d-d57447dedc42 X-Ovh-Tracer-Id: 6856730434922256885 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduiedrudefledgudduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvffukfgjfhfogggtgfhisehtqhertdertdejnecuhfhrohhmpefirhgvghcumfhurhiiuceoghhrohhugheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeevlefhtddufffhieevhefhleegleelgfetffetkedugeehjeffgfehhfefueduffenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddruddtudenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehmgihplhgrnhehrdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepghhrohhugheskhgrohgurdhorhhgpdhrtghpthhtoheprhhthhesthifihguughlvgdrnhgvth Received-SPF: pass client-ip=79.137.123.220; envelope-from=groug@kaod.org; helo=smtpout1.mo804.mail-out.ovh.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/02 04:59:26 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Sep 2020 09:00:28 -0000 On Wed, 2 Sep 2020 10:07:59 +0200 Philippe Mathieu-Daud=C3=A9 wrote: > This variable is used once in an assertion. Remove single > declaration and access directly in the assert(). >=20 > See in "qemu/osdep.h": >=20 > * [...] disable assertion is not > * supported upstream so the risk is all yours. Meanwhile, please > * submit patches to remove any side-effects inside an assertion, or > * fixing error handling that should use Error instead of assert. >=20 > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > --- Same remarks as patch 2/5. > hw/ppc/spapr.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index dd2fa4826b3..6447a5b3808 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -628,7 +628,6 @@ static int spapr_dt_dynamic_reconfiguration_memory(Sp= aprMachineState *spapr, > static int spapr_dt_memory(SpaprMachineState *spapr, void *fdt) > { > MachineState *machine =3D MACHINE(spapr); > - SpaprMachineClass *smc =3D SPAPR_MACHINE_GET_CLASS(spapr); > hwaddr mem_start, node_size; > int i, nb_nodes =3D machine->numa_state->num_nodes; > NodeInfo *nodes =3D machine->numa_state->nodes; > @@ -670,7 +669,7 @@ static int spapr_dt_memory(SpaprMachineState *spapr, = void *fdt) > if (spapr_ovec_test(spapr->ov5_cas, OV5_DRCONF_MEMORY)) { > int ret; > =20 > - g_assert(smc->dr_lmb_enabled); > + g_assert(SPAPR_MACHINE_GET_CLASS(spapr)->dr_lmb_enabled); > ret =3D spapr_dt_dynamic_reconfiguration_memory(spapr, fdt); > if (ret) { > return ret;