From patchwork Fri Jan 5 15:43:00 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: 760225 Delivered-To: patch@linaro.org Received: by 2002:a5d:678d:0:b0:336:6142:bf13 with SMTP id v13csp111600wru; Fri, 5 Jan 2024 08:02:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3SVqxglTrFYqmoP4lDTiwmz8fjlpMLYAGv5tQV9t6qRLprAR2MyMcEdaK8qEP6lWRKX+H X-Received: by 2002:a05:6214:5090:b0:680:c86d:3f6c with SMTP id kk16-20020a056214509000b00680c86d3f6cmr2118998qvb.36.1704470520256; Fri, 05 Jan 2024 08:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704470520; cv=none; d=google.com; s=arc-20160816; b=eZeilQPa7RmzB+aEf4gjhjLvEXuYFECozSsSgrTFvB6jGVku1eayHQv7cMzdY6di+q JU6LVw7CKE4dW6d9UxEAilPjgzZWUtsDXsJOdwQhh2fmsU5Szmg/n0K2P8PE3rzvUNaj iOvHMm8DvJ2e5ciJN12GWWpU3MVnrP3uw7zSLE7FiAaRdD9q8PbepW/a5kzn2+q0SbEp N2VFNljK2GTQdw4oupe17yxNjMtvlhQwqnvW8X3TjAC0ymXiRP31t9w5j072UBCWqrJL zIhIFr8TcEkKECHquIGZCV621hp63Jx/4OXHzeOYK4EdbTbYKU6LYW1xdBnl9LUPi2ul neRA== 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=h8Y9INkkzpXAHIBaDV6X4EdXcLZoAOfyToK+IgBwRCs=; fh=+qf+pcB7BYjjnfnO4Nktpjd3J5C2qdC6t0g0pNpbakY=; b=WM60R0S2YjI6aDwnRusBgh6XabhV7x99I52rMnP/zdW4jKgriurWnMTFQH2TE5Bfkk PXFDzShlwwmKCmcEN3IjYQX0Ub9rY7u0VufGQy7MZJ+ahziO1SiJIYhU9/XeNTOweFwR vFkLkw6afKQm32/u07CMMvYQdt9DTv+MWyvNOetOZ8Iqo3D/LLRsUm0HEgvP0WPmiPvA q64ebERA9w+O2i462ljw9nYsLAT9gU19AG5IvlOoffhbDKh2qs9VoH4YblrQ1I8WDRAM dmSHUg8J4A8cYQ6oYblU6NlIvZEDCwyVapWRqemaKf7jM96Ic2gkzh7UzRtXws6sUggJ WwTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=trG9EbVh; 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 c17-20020a0ca9d1000000b0067fae3119a4si2027875qvb.433.2024.01.05.08.01.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jan 2024 08:02:00 -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=trG9EbVh; 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 1rLmTW-0003fz-E1; Fri, 05 Jan 2024 10:51:10 -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 1rLmSO-0008WF-Ub for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:50:03 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmSM-00010K-69 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:50:00 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40d5f402571so19120245e9.0 for ; Fri, 05 Jan 2024 07:49:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469796; x=1705074596; 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=h8Y9INkkzpXAHIBaDV6X4EdXcLZoAOfyToK+IgBwRCs=; b=trG9EbVhTGYocEygqSoykHHDkh1JoR0PUhzxazvHz7oZ+PleHicBzuXNFOjxTqEdDK 8By/C6OFTFxt2LuM7D35vPSxPo5QBx5ucQfRiq4Z5tiBTgUDo/1P2XckLZAGMtk4LQ/l 2Keu9fXhHLFt+ix/xtuFH/axA4ea7Ne4l9ybsrDQU/mbkD8y3vIuS+eFtm+7MzX6zad1 vR9ZifAi9/DdS8gdg56M0j/w/alidI2k/fsSif4vcdnbGqB1ZlhHqUMF1h2LwRMzawVi UOYQs7Dogxrk8Lq4RoqKbjkyP4HscJ4Np4DT561c6jjxMWMM9I0ZFYUGyzODoK/yfwKE gitQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469796; x=1705074596; 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=h8Y9INkkzpXAHIBaDV6X4EdXcLZoAOfyToK+IgBwRCs=; b=ObkRZNGhexxhkhmbOZgpnuyrdqjYw64+8DMui/RN6M8MVIK+/GPr7jursLGBn2mqiY lnzeiHov8FC1CMoplFmGfU8oGjJYbnzfXgPMRZu9bRzMFMq44m/tfEK2NoqafgUMQi2T EaSkgmQs5EyelbsZtJOxh4Gor277hcbUvOeCnbos/vydDx9iDqctc6TxjVUGRhJ8NArB 8Yt0iFTFXR+jKjSSnp5djuawXkR+4qUCvoRQMuVPzfPn6CaxrCx7DF/DQenLz66TnDlI EhLdZkQot+ECh7tmF+P/cXB57SfMLUj2V9uOyhWJn7FqDGK/Ll05P0FgKZGobE7zBBd3 7SWA== X-Gm-Message-State: AOJu0YyiJShQLi0zkWFzwrNNEQ+oUbWNNLZ37KQCXSBeDoZPB3EJsWC4 6qlmQlbhdFugdbcnW0XL0xLv4FUtHkOI6TlJ78RsAvPJ+DI= X-Received: by 2002:a05:600c:a02:b0:40c:45e:f89a with SMTP id z2-20020a05600c0a0200b0040c045ef89amr1280111wmp.50.1704469796358; Fri, 05 Jan 2024 07:49:56 -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 g11-20020a05600c310b00b0040d94b65342sm1927739wmo.48.2024.01.05.07.49.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:49:56 -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?= , Manos Pitsidianakis , Gavin Shan , Joel Stanley , Peter Maydell Subject: [PULL 67/71] hw/nvram: Simplify memory_region_init_rom_device() calls Date: Fri, 5 Jan 2024 16:43:00 +0100 Message-ID: <20240105154307.21385-68-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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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, arg5, arg6, errp; @@ - memory_region_init_rom_device(mr, owner, arg3, arg4, arg5, arg6, &errp); if ( - errp + !memory_region_init_rom_device(mr, owner, arg3, arg4, arg5, arg6, &errp) ) { ... return; } and removing the local Error variable. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Reviewed-by: Gavin Shan Message-Id: <20231120213301.24349-25-philmd@linaro.org> --- hw/nvram/nrf51_nvm.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/nvram/nrf51_nvm.c b/hw/nvram/nrf51_nvm.c index ed8b836074..73564f7e6e 100644 --- a/hw/nvram/nrf51_nvm.c +++ b/hw/nvram/nrf51_nvm.c @@ -336,12 +336,9 @@ static void nrf51_nvm_init(Object *obj) static void nrf51_nvm_realize(DeviceState *dev, Error **errp) { NRF51NVMState *s = NRF51_NVM(dev); - Error *err = NULL; - memory_region_init_rom_device(&s->flash, OBJECT(dev), &flash_ops, s, - "nrf51_soc.flash", s->flash_size, &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_rom_device(&s->flash, OBJECT(dev), &flash_ops, s, + "nrf51_soc.flash", s->flash_size, errp)) { return; }