From nobody Wed Nov 27 07:35:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700516066; cv=none; d=zohomail.com; s=zohoarc; b=fR9rFtLn/5uB0qiJVDHo5eH8N6RBx9sZ9micHo3BAmkPMiWJY0NaiLdu9MmMkyTh6DWlc3953zSNfNGEMawsG0A4LsaSMVeaEIZPj1wPQL4OlUvH1a3GqpZ3RYrY+41WK0aR346SFJ8WzcoF9hJWB0SaBYAsZIaCLpZhIDefx6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700516066; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fonaudvT/zI6eYgx9UtSiLdTbmVbD2gVa6JY6eKabgU=; b=UcCg1QB9Bg1my89D39XnH2jRlczBuk7V5YJ8UEB1foewBHkkKji2rfLFsRbGmiSoWGuWyRtksdj246AuiCHo2O+mBMpyXrDajip1cEAwGdzROtww4ZQamdRmRamL/3SWiBdbwbcwjNpmK13CV/5UQi8VjKC21x/MGjf8r/uU6bI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700516066862408.32113700019215; Mon, 20 Nov 2023 13:34:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5Btz-0001AD-4y; Mon, 20 Nov 2023 16:33:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r5Btx-00019c-9G for qemu-devel@nongnu.org; Mon, 20 Nov 2023 16:33:53 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5Btu-0003DP-Ex for qemu-devel@nongnu.org; Mon, 20 Nov 2023 16:33:52 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40a5a444c3eso16881325e9.2 for ; Mon, 20 Nov 2023 13:33:50 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.190]) by smtp.gmail.com with ESMTPSA id je12-20020a05600c1f8c00b0040839fcb217sm14809038wmb.8.2023.11.20.13.33.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Nov 2023 13:33:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700516029; x=1701120829; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fonaudvT/zI6eYgx9UtSiLdTbmVbD2gVa6JY6eKabgU=; b=INOhgKhilQedlZMhwtosqFZpSxTUqRnWapdsPPsXvpkFW5XoqvunY//K0AJptYpA5n GKlJbOhqK0H9P+lOGs8W6d6BVFsaeBc2OLIBuBsOAkEG9Inhz1LD3GgJVLuW0wPCUJir zRi4A4D7QnMLzFjKQ8Nj4G0rC9G7Iq3ZxNHqbcwI9YKiBaW3ew3IGZY6Z0Sfq598pCfT dTPrYayzQz+HwLJpF2EjKE4ec32Qsc+ZT9wo/W7bUcYhT2HKkxkCbQf0wSCQ+X/IhUol k0galAB/etIzsr5uqFRZ5dysweBNX/I2YkS2kcPAgFTm/4uKZVxhoH3R864xjX7PfSVM HVFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700516029; x=1701120829; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fonaudvT/zI6eYgx9UtSiLdTbmVbD2gVa6JY6eKabgU=; b=m8B3HanIeWqvnpRewilmmybj5FFbX4AwE3XTbTVMI5OxIvtVfFc3+OJRYPICjexojc fEG1mCSYJqiS8tFMXf/DYpi/KVAGHBsXy5qEjhGF7RQmsMI5NE//ZlJTg6iWUUfRcYz0 mvUkTl9Ex0k3C3EKHXpbAH3nj1yFi2dcXBiqitBhzZWuvGbjN+Z+ED9L+lmDbtnoiaV5 UG352LNF5shJZYLUAzVCCecU2+nZ/La9qtWtOX/G0/b/8Pd+qcKwt28UEIkREen6Rd4K dQrqfN4AITiAKyAaTS4nB3yFUWJLn6PrZe6Duc5pB6gc7B0xY3OF6GwivtvgsBz3u+mK T0+A== X-Gm-Message-State: AOJu0YyedRJMSkfyXLCMVg3YjpTsTBGdfOZ6qghY/Mv72PkXiyppV2uf CKatQVEm0Dqirrg4PHVk0PJHoZJsGjSF1mT2xhY= X-Google-Smtp-Source: AGHT+IG+UMzpfApSrpqBcDz7//bNLjdvqb0aTsN1x9v0ryzyBvE+PB3hSXzV/HU8pb9pxUnHkU5P4Q== X-Received: by 2002:a05:600c:19d2:b0:405:4f78:e128 with SMTP id u18-20020a05600c19d200b004054f78e128mr6897554wmq.4.1700516028900; Mon, 20 Nov 2023 13:33:48 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Hildenbrand , Peter Maydell , "Michael S. Tsirkin" , qemu-arm@nongnu.org, Mark Cave-Ayland , Markus Armbruster , Paolo Bonzini , Igor Mammedov , qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu Subject: [PATCH-for-9.0 04/25] memory: Simplify memory_region_init_rom_nomigrate() calls Date: Mon, 20 Nov 2023 22:32:38 +0100 Message-ID: <20231120213301.24349-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231120213301.24349-1-philmd@linaro.org> References: <20231120213301.24349-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700516068642100006 Mechanical change using the following coccinelle script: @@ expression mr, owner, arg3, arg4, errp; @@ - memory_region_init_rom_nomigrate(mr, owner, arg3, arg4, &errp); if ( - errp + !memory_region_init_rom_nomigrate(mr, owner, arg3, arg4, &errp) ) { ... return; } and removing the local Error variable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Peter Xu Reviewed-by: Richard Henderson --- system/memory.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/system/memory.c b/system/memory.c index bfe0b62d59..2fe4c3861b 100644 --- a/system/memory.c +++ b/system/memory.c @@ -3628,11 +3628,8 @@ void memory_region_init_rom(MemoryRegion *mr, Error **errp) { DeviceState *owner_dev; - Error *err =3D NULL; =20 - memory_region_init_rom_nomigrate(mr, owner, name, size, &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_rom_nomigrate(mr, owner, name, size, errp)) { return; } /* This will assert if owner is neither NULL nor a DeviceState. --=20 2.41.0