From patchwork Fri Jan 5 15:42:40 2024 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: 760208 Delivered-To: patch@linaro.org Received: by 2002:a5d:678d:0:b0:336:6142:bf13 with SMTP id v13csp108427wru; Fri, 5 Jan 2024 07:55:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJ/1V0/lbS/RKLBNuWI0RRFv+thIBt4gJ9eNUaAdic6cLmsAU8KBLG6ipI0Ed/qaOKQvZI X-Received: by 2002:a05:620a:15b8:b0:781:4143:b980 with SMTP id f24-20020a05620a15b800b007814143b980mr1873308qkk.61.1704470129383; Fri, 05 Jan 2024 07:55:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704470129; cv=none; d=google.com; s=arc-20160816; b=MWICZOCaHKX4g2sRAaee0kzUo+vmiF5cqMopItycH/xwhlQTqrLvQ03m60xm1smnUP OhFwjlvmbdlmkPYMWullw8XMGZiMLP/Wwpj3AAslYLeu5aHJInXMBDjOkxWRuZA6bBPf FqRMgTyyPWkFSEAl2rmCOcpjPNKc/dtUdoS+oW9wSm1qVsRrGiOfUTc1xbElRbo+8dhJ hnPhHbKT0V9/wBFi+zzA1LYrUkXorg9ekPs37H1aWGoertD/2juywyOMLXnmGUkTX1ZD Ajqjr55MM/izGPDqpkjUv634NHwgFQxGynNbLsGO149AEFVUdz99jYsslRIkbmxM2CdS KCeQ== 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=rwNOMMIAYzGSLWabz4mQJXWqt1PJzQTuexNMmuOK734=; fh=c+l8ms79slf+HkInAquXl8YtF8vGf6PikhLcunVcZ64=; b=s9LGBGex5Ty1A6xG9A5/c5Wswprs+uFBcIC5XYZLEigLud7WbCbvenikP8Y2ExlM3x zJmZ0puwn/hTKFZ3SNVkjtf9OFBHD+oKVss+Fx1re4AKD4bzlM8oSDLPRDaSw8hxp2AM HX3TG+i4uZc75GAtDM0aQ0RCtSuDXWGXzK1GZrmELlw2uTKZWj22d402QUn6s3pB+/0V wsUHHDZFMd8eMEgOzgzrNFY4ee7r5kDkYlK46YgUWh3jdp5E9f0WO19IAx8S0nyeqB2T uWiOZwixhCJlvtByVKhxUtUn4/YQNBT0uskP9oDqEoQXz48zyrTxod65a9oZ0fazp4+n jXtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zTpWELja; 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 y19-20020a37e313000000b00781b518af18si1885039qki.709.2024.01.05.07.55.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jan 2024 07:55:29 -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=zTpWELja; 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 1rLmRK-0004Vt-M9; Fri, 05 Jan 2024 10:48:54 -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 1rLmQe-0000WW-NX for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:14 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmQc-00052M-EM for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:48:12 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-336990fb8fbso1224171f8f.1 for ; Fri, 05 Jan 2024 07:48:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469688; x=1705074488; 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=rwNOMMIAYzGSLWabz4mQJXWqt1PJzQTuexNMmuOK734=; b=zTpWELjazCjgv0efnlE4zgCZ6HMfKPlhg7nalHCtNUcEufcNlCWuRjuP6LJ9uo75Ur +ULrhv/L//U7gescR667EK9aNhCAPgAS8DWNrKeVSbPTXSLugeLAee/nUj3nl4cEBez/ F331TfRBGXG4m0zMU6p+k6Nh0HmUpU0NP91eJFH1AGeyRcyX2GNwnhPpWO9ksIBaZlps eR+BMefEpXYEBfigksRECRFsDbzf+JDqMOeGJVmHb+MRGf37TATqYwxecIizGM5M+ZD3 7TxuOS9ny3tgcLdMuthxk+SbODKAIGH7osJoZBxrlUBgL/0xxDSVgVPbryjwvtywRgcy kFdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469688; x=1705074488; 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=rwNOMMIAYzGSLWabz4mQJXWqt1PJzQTuexNMmuOK734=; b=ZGca/5HBoc+Q/9fXmWFSsAz3bwFx6DhyuyAz9pITAZRACkH3FuGjGiOpfS057LKHJu 5VrJInZyWjMuN4NhRcrLMefk2ZZkKCHQxnhYSHX3U9R5HIiP/Z3uMyq0jojKf+Gycpae gTqA7/hIUxmpr+E6fvPygt7euOh7nGOoE7KE63BEZJjMKyQ1Kgg+oN3CSQL9JFFUKEP5 z+bL7NG/TwhOB9zF747SMcWVKvDAjeF9iqXsO5wWexxsCmeESpJWNjNC7PPLmGjItnyB obuTpjxXuV58xxcNWxiva5rQiWmEtw4LyWwoWQyDXk7J56j/jvwEB/cwDsf+AUM0hBDk F4+g== X-Gm-Message-State: AOJu0YxjYS25e+9Ps07VuH0N7sUCvB0GKMsTXN87JoLe2LEy7+zR4LyZ VH59wzfiKhrbhDI+U5ESKVUAxmum/5iCMHc6KZYQfN4TRYM= X-Received: by 2002:adf:e0d0:0:b0:336:e366:471 with SMTP id m16-20020adfe0d0000000b00336e3660471mr1336264wri.58.1704469688486; Fri, 05 Jan 2024 07:48:08 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id o5-20020adfca05000000b00336ee9edbb3sm1605985wrh.94.2024.01.05.07.48.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:48:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , Richard Henderson , Gavin Shan , Paolo Bonzini , David Hildenbrand Subject: [PULL 47/71] memory: Simplify memory_region_init_rom_nomigrate() calls Date: Fri, 5 Jan 2024 16:42:40 +0100 Message-ID: <20240105154307.21385-48-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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=ham 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 Message-Id: <20231120213301.24349-5-philmd@linaro.org> --- system/memory.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/system/memory.c b/system/memory.c index 72c6441e20..3997ac5928 100644 --- a/system/memory.c +++ b/system/memory.c @@ -3601,11 +3601,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.