From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08CA7C433E7 for ; Wed, 2 Sep 2020 09:01:18 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C2E1A20709 for ; Wed, 2 Sep 2020 09:01:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2E1A20709 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kaod.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDOdo-0002Ir-Ul for qemu-devel@archiver.kernel.org; Wed, 02 Sep 2020 05:01:16 -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=?= 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-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , Corey Minyard , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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;