From nobody Mon Feb 9 10:12:12 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=1615333861; cv=none; d=zohomail.com; s=zohoarc; b=EzruHV3by4ORjaMt6IPeToJvUcHdRAJDwemQC0X9PbftSoKJFewnoUlO2fuXB6Zp59cyVYhS2rmdU6JDUOJZYvb2cO8A8PD22mtaeaubixxvPQtkq7y2/84CguXM+FbiroA3eFxe+1GlfwK6lEQmjDGwn+MyfjBH3v90/e/Xchk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615333861; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=q/qFh6Xk9X0lvLpKMyB8xS7GnadqS9EROoiuzpTd3qo=; b=UxzXATfLKbmeTAVP5wCkd6KtdagJq/Oa+sFN5Yz/8Eh1FolFQ9MkNqJvfatEbU4faFdxg3jok/piWNUx4Lo6/8dM9LuPImE2WCBEh6Tq27hIqzLzuVOajDtJIW5KmG5W2xtIABOMBFoVWr3VQUJ44AdrK76YklWCX8MIGRzGaSk= 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 1615333861350425.74677410099014; Tue, 9 Mar 2021 15:51:01 -0800 (PST) Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-319-JkT1rYDlPyS_yR2xCq_u2Q-1; Tue, 09 Mar 2021 18:50:59 -0500 Received: by mail-ej1-f69.google.com with SMTP id gn30so6347909ejc.3 for ; Tue, 09 Mar 2021 15:50: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 gt37sm1632919ejc.12.2021.03.09.15.50.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 15:50:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615333860; 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=q/qFh6Xk9X0lvLpKMyB8xS7GnadqS9EROoiuzpTd3qo=; b=AGNn0T1ChXqHkqQaOPxYFJvMAlPNmXP4k97fWkrgosBmvFKBI/TLjqbS+w6jXVGbTmv1bO iE6xibhMwB9utbY6gVpG4Fb03XzfP80avpP5Litrt+f2lDm2iKN7oj7yM4WWythN/vS9Eb 5BsPn/CteTsSRoXzHb1aRehHgvE7kpE= X-MC-Unique: JkT1rYDlPyS_yR2xCq_u2Q-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=q/qFh6Xk9X0lvLpKMyB8xS7GnadqS9EROoiuzpTd3qo=; b=UrYQznFj4qyyoEPOlwjXZ45ZHGV5EgcDVn3ae5DWkRQ/heXNgCWr63cmXvR5s5CHLk PqFDw1Tf3/qTVKKkfgo+Tq/z9iOtJAw/bBwRMP3ZFdAlpn3hjC8PJabTRh8pMtkZfKXC JRYvZzCOlY7DABbMaII5Z+EecF+3rMunPFuj08CdxReK6jX/1xox+F4I3JooK+x2/V7x dO9EVfkRMJ1tCQ6uksNQVdXtU6PMmuHmhBSkNu+208QcR5P6dvAw94TRzEGgcsJh1Fsm eHQuaZQtf3Q3WjE4lLA8msxOUs4e2UvjHHy5KdBnRyhK6lhaiD92N7CVlamYr6F6wVFY HdvQ== X-Gm-Message-State: AOAM533jADYEl7UL+RLyP8mZXqMxLLO0pLpLHNq5sdgCMxIpacI1X2dk y/Ar3MGCeowZfwAIODV/W3H+T4r1sWfxo6ZY2HDAj+jbZNFSfbLAZHjR20R1AeR6X9tKD34XRhN N/VC+iMwJ1LIORQ== X-Received: by 2002:a17:906:add7:: with SMTP id lb23mr547336ejb.273.1615333857861; Tue, 09 Mar 2021 15:50:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbxQqKkXc9vnwzMUQF/ITk6sOkSsFWeMVQ11Gg30iVDpo58qrs9xT1vJQQJ0oBBG3z4C7PSg== X-Received: by 2002:a17:906:add7:: with SMTP id lb23mr547324ejb.273.1615333857719; Tue, 09 Mar 2021 15:50:57 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alistair Francis , Max Reitz , Kevin Wolf , Stephen Checkoway , David Edmondson , qemu-block@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 5/9] hw/block/pflash_cfi02: Open-code pflash_register_memory(rom=false) Date: Wed, 10 Mar 2021 00:50:24 +0100 Message-Id: <20210309235028.912078-6-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210309235028.912078-1-philmd@redhat.com> References: <20210309235028.912078-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. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bin Meng --- 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 5f949b4c792..4efbae2f0c9 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