From nobody Mon Feb 9 19:06:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615395961; cv=none; d=zohomail.com; s=zohoarc; b=nwPqHzUPSrOUmB/4KuSB0tUR2xugg4gcvPAZH7LjUlGG3Za0bcM9N6AhkeRUrwT0NzvHcFo0TMo2OVgz8J4qvf4dE6P+SSZjhLTS4U35ChvhRfiYGDHcuJNfHkPSF7t7Q8CxaEmdZiuF0QhHQqttdfXbFn0cJPwYtvLN9yNj7dI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615395961; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=WcGfRNYJ0BsERVuaAzhPbzUUIPMEXjXUCFh4a0jlWNQ=; b=QXnx3T6ko+RVgtHmgkX7+iNQh9ozMQyI/pYSnt0y3rGq1/0apeKLzsjG3CGsUH0umlyphKetxWiFbGX2jXhtT0ljI6foKeKoEL2FxnJLczkh0DixqyLKYxsVWljJWKx14igAhgbfIS/MbnxCN06Ol1REzx0sSySxRyqSkHCtL30= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615395961713911.6126950795569; Wed, 10 Mar 2021 09:06:01 -0800 (PST) Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-235-LTYtflJVPYCRT1sfS8rYtw-1; Wed, 10 Mar 2021 12:05:59 -0500 Received: by mail-ed1-f70.google.com with SMTP id p6so8643405edq.21 for ; Wed, 10 Mar 2021 09:05:58 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id u24sm34858ejr.34.2021.03.10.09.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 09:05:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615395960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WcGfRNYJ0BsERVuaAzhPbzUUIPMEXjXUCFh4a0jlWNQ=; b=SWw3VXm4QztITsIR8ZHvJQAx716YygaJMVnBMGoDcywGqqruZ6VYwgwLnSmk2qNA9Ds/xp SGeeVkDkcRx+Rxr6+5hfnPvOXIx6EGIjhW9F6i4Z2wYDcIAzqpZ3F6CdInAn+JVXxpvhDw /za06UFkS+osLqv/JSY9FaBM4Uz6kp4= X-MC-Unique: LTYtflJVPYCRT1sfS8rYtw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WcGfRNYJ0BsERVuaAzhPbzUUIPMEXjXUCFh4a0jlWNQ=; b=s1vD+vvcsP7XDPgZ+WM0NEDKied2LWDDZVG3zPg10urQ32f04+s1poUNJOQJPpP77M w1CttPQt9LVi8fMuec/BRZ94gCHO/nUYZg2ns+pPd73ihJQj1nVg4YHZf5cUHRQ6yVJb 1j2k5frEUWLNmBicl0u89tprmhNeXhL7a2sDg5tt5Ln0s4WNochjt0dFsjHy8W/MUZZQ Lx4Cdgv8mAgHfKe5djFyLwQYBFPnos9O9NzKCfae9oPaeKU2jNTwx9RhuaI0CjApU1Wy E2M3vVBRJEe7GTXCv3Kys6vm0nbUFzeBHyW0Lwq3mnLARSwCDesgVAFwT0n19Ycva3hz 8/Eg== X-Gm-Message-State: AOAM533CAsLvcOJmzOMvyeMIA7ZCS9oT5gIp9ojNt0/Zh1wGk3VSK8pX qJGXXu7ymIiraBMIFCPUMzO2IBRT55L906zwP65LIFyNC5VXFrCF6k36nMGu6mYbaZASzsBXCE2 pCuyy46DZa5CvIA== X-Received: by 2002:aa7:dc4e:: with SMTP id g14mr4526782edu.114.1615395957888; Wed, 10 Mar 2021 09:05:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvZ7K8yOFFJlQ6xMxkxrMQ34i1EbREce+mFhbUWaY5HpOF+n4yFRw+Keij723cXumQm4A4Sw== X-Received: by 2002:aa7:dc4e:: with SMTP id g14mr4526755edu.114.1615395957691; Wed, 10 Mar 2021 09:05:57 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alistair Francis , Max Reitz , David Edmondson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Stephen Checkoway , Kevin Wolf , Bin Meng Subject: [PATCH v2 05/12] hw/block/pflash_cfi02: Open-code pflash_register_memory(rom=false) Date: Wed, 10 Mar 2021 18:05:21 +0100 Message-Id: <20210310170528.1184868-6-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210310170528.1184868-1-philmd@redhat.com> References: <20210310170528.1184868-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) There is only one call to pflash_register_memory() with rom_mode =3D=3D false. As we want to modify pflash_register_memory() in the next patch, open-code this trivial function in place for the 'rom_mode =3D=3D false' case. Reviewed-by: Bin Meng Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: David Edmondson --- hw/block/pflash_cfi02.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c index 0eb868ecd3d..897b7333222 100644 --- a/hw/block/pflash_cfi02.c +++ b/hw/block/pflash_cfi02.c @@ -467,8 +467,10 @@ static void pflash_write(void *opaque, hwaddr offset, = uint64_t value, switch (pfl->wcycle) { case 0: /* Set the device in I/O access mode if required */ - if (pfl->rom_mode) - pflash_register_memory(pfl, 0); + if (pfl->rom_mode) { + pfl->rom_mode =3D false; + memory_region_rom_device_set_romd(&pfl->orig_mem, false); + } pfl->read_counter =3D 0; /* We're in read mode */ check_unlock0: --=20 2.26.2