From patchwork Mon Nov 20 21:32:38 2023 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: 745378 Delivered-To: patch@linaro.org Received: by 2002:a5d:5052:0:b0:32d:baff:b0ca with SMTP id h18csp1532744wrt; Mon, 20 Nov 2023 13:34:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IHbuZMlyjybIWPN4H+wo50ll8eZzjXNzFvxRtqb5ke1g7+a+ZRMIUAi8HeCPCQHryEjSKTH X-Received: by 2002:a05:620a:51ce:b0:778:8cce:dbf3 with SMTP id cx14-20020a05620a51ce00b007788ccedbf3mr9695303qkb.46.1700516066704; Mon, 20 Nov 2023 13:34:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700516066; cv=none; d=google.com; s=arc-20160816; b=k6ztOEwzvQGjpRkIWVPUfCwsMztV5KJWe740BUqxOeEw3jztYyFioGg6UeoCEc9g35 wZEbyNDMneVtgOQ9kgLxMgG6tMrxy823eEc0Q24YYWw2FqSVZ7BD821yWyO4zEVOMeWK juMKO6GybFlYwnBSUSuRtMVQ6BRmm5090YMvlnJy4H3Mydz5o9TwXH1nIKLAyEWtCD1i PyCB6FWakwUTZX+8wYJBtNz12bcTI66CFXxB4W1UKfQBQJMlU7mcG3NDT0ysqlUBpydL 7yaF3fuQJOXVwSdcyK89IRlz6JzIofAesQuqYlCifscAMWEaWOmjwSZQVjrcnPecZqjE fPbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fonaudvT/zI6eYgx9UtSiLdTbmVbD2gVa6JY6eKabgU=; fh=toXMQ9nuJ3L4CLQ8EKaTQ8L/ltDlD3GauRZSJpgYVzU=; b=EjzEmSH0Vu/bJtsScSM/e9XlbgzK5GkU7J3XloSLdwEmjtHcnFXWgey7ObiA/P0PxE gaRoWtk5RYMt3SvkK8R2VjPwFI8sX4Cg/C+EPOPltBloNpKN+c58IVajqvCb9BH2ZY5Q owRLB611o8ugElYVVU8I+ir3JSrvDjAZTmBfe0CtkcsGeOaimutqbjzMtCwt+J4RvwcX M9gAk2jdtv3GYapHllDbvzgLd/ppQuzqIK1pj112xhnCzTBh2Ox98esSxFmdgBsWlzE7 5g4sNwepAt4FAxrIC4tXziCDIX8vEO0Zt38mRMtNpuI4P2JolZCXixSHCZNdYTUFZbzo enWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=INOhgKhi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x10-20020a05620a258a00b007683ee37758si8265758qko.86.2023.11.20.13.34.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Nov 2023 13:34:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=INOhgKhi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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=A9?= =?utf-8?q?dric_Le_Goater?= , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Reviewed-by: Peter Xu Reviewed-by: Richard Henderson Reviewed-by: Gavin Shan --- 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 = NULL; - 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.