From patchwork Mon Apr 13 20:33:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1269938 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=aNw7cq3+; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 491L2m6P0Jz9sP7 for ; Tue, 14 Apr 2020 06:34:55 +1000 (AEST) Received: from localhost ([::1]:48521 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO5n9-0005Xy-Lb for incoming@patchwork.ozlabs.org; Mon, 13 Apr 2020 16:34:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34164) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO5mK-0005DD-Or for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:34:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jO5mJ-0000lw-MW for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:34:00 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:37988) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jO5mJ-0000lg-GB for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:33:59 -0400 Received: by mail-wr1-x442.google.com with SMTP id k11so11016170wrp.5 for ; Mon, 13 Apr 2020 13:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TSTOgqIqkHP/A6SEq23VPb4QmBizW4+fbueFj4i2CPw=; b=aNw7cq3+8KXzWk3JWdUnifnGtCtfiMMk9+0FNN4hsxYU8NUL4ihIN0QZ/59z7S5oAE 9wCoMBzMHzsuOao8uSC9ItkEplzIn3uL1PJpbDCefxQ9g4Zn20GqutEnIt5wa6ONZUM2 CDsFJTJF/Q/bfNc6Xw2d4j9VZYqmF2aXwD+UZGL1/d8VxyMKK94dtCqkvnDzZ3+nIHIH v/uDVu5yOfqgBWGWUCbzozu9fcaWmEcV7zDHXx+8qEVwv2+TnC44sgOdr2lJNc/MJGw6 i3FnY1fimduDHHiB/vR6osAUYNHbKd82bulwPjA606/g9LsGyt3q/d26FgwU1LcIq9Dv jwjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=TSTOgqIqkHP/A6SEq23VPb4QmBizW4+fbueFj4i2CPw=; b=PFfxoaVRnFcWHoUcYc6ElZCAvwVnQHJ7YuwroiGlmdEUkr0zN6CjDL5JYc33E5SiAm acwYgcWBLzrEoKNJIh6SGvtO1IyCtT+8VggsrdRor3y2OmN8UYOrWaNypLpGGBQc7Yhg XPHEu6wD0N42gF4Q+qwkyxGaqe8YPogjDlyttt4RCcjfAkQ5nzwuSnxNl95vYjp5JP0n Fzf6NY29tzOfq3z2i9ldkhmjqpNTTimzxkY3TdWSIrhKrISQKLh034y7GA5aBcuYQ9Ay rKEy7blegW+ERzqeIfpy1tc+e7OhzNPqw4UhF3JOopgqBN6iJtJOCtK0OLNf8QcXbAD0 +PQQ== X-Gm-Message-State: AGi0PuagBcJu5PNssGlsl8qFM4Nvw8ChCA/oOsfWsTLugg5JV2e3xGAe +xXPhCzUBCat2SJsl5/g09OAOk3rBJ/4Lg== X-Google-Smtp-Source: APiQypJiBME2Z8nP2c+ZIdmqOWuUO4dAGgiEvbalzHjaDeEA0+leygUgmTik2/BLaBUTZP/DabfxCg== X-Received: by 2002:a05:6000:4:: with SMTP id h4mr20875286wrx.386.1586810037973; Mon, 13 Apr 2020 13:33:57 -0700 (PDT) Received: from localhost.localdomain (116.red-83-42-57.dynamicip.rima-tde.net. [83.42.57.116]) by smtp.gmail.com with ESMTPSA id i97sm17519238wri.1.2020.04.13.13.33.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 13:33:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH-for-5.1 v3 6/7] hw/mips/mips_malta: Use &error_abort in MachineClass::init -> create_cps Date: Mon, 13 Apr 2020 22:33:49 +0200 Message-Id: <20200413203349.30590-1-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: 20200412224517.12869-1-f4bug@amsat.org References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 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: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Aleksandar Markovic , Aleksandar Rikalo , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Running the coccinelle script produced: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/find-missing-error_propagate.cocci \ --keep-comments --smpl-spacing --dir . HANDLING: ./hw/mips/mips_malta.c [[manual check required: error_propagate() might be missing in object_property_set_int() ./hw/mips/mips_malta.c:1193:4]] [[manual check required: error_propagate() might be missing in object_property_set_str() ./hw/mips/mips_malta.c:1192:4]] Since create_cps() is called from a MachineClass::init(), replace local Error* by &error_abort. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- v3: Use &error_fatal (rth) --- hw/mips/mips_malta.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index e4c4de1b4e..477ee6cc5b 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -51,7 +51,6 @@ #include "sysemu/reset.h" #include "sysemu/runstate.h" #include "qapi/error.h" -#include "qemu/error-report.h" #include "hw/empty_slot.h" #include "sysemu/kvm.h" #include "hw/semihosting/semihost.h" @@ -1185,17 +1184,13 @@ static void create_cpu_without_cps(MachineState *ms, static void create_cps(MachineState *ms, MaltaState *s, qemu_irq *cbus_irq, qemu_irq *i8259_irq) { - Error *err = NULL; - sysbus_init_child_obj(OBJECT(s), "cps", OBJECT(&s->cps), sizeof(s->cps), TYPE_MIPS_CPS); - object_property_set_str(OBJECT(&s->cps), ms->cpu_type, "cpu-type", &err); - object_property_set_int(OBJECT(&s->cps), ms->smp.cpus, "num-vp", &err); - object_property_set_bool(OBJECT(&s->cps), true, "realized", &err); - if (err != NULL) { - error_report("%s", error_get_pretty(err)); - exit(1); - } + object_property_set_str(OBJECT(&s->cps), ms->cpu_type, "cpu-type", + &error_fatal); + object_property_set_int(OBJECT(&s->cps), ms->smp.cpus, "num-vp", + &error_fatal); + object_property_set_bool(OBJECT(&s->cps), true, "realized", &error_fatal); sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->cps), 0, 0, 1);