From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0002C433E6 for ; Wed, 10 Mar 2021 10:59:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D1BB64FE2 for ; Wed, 10 Mar 2021 10:59:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D1BB64FE2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=dme.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJwYl-0004sM-1X for qemu-devel@archiver.kernel.org; Wed, 10 Mar 2021 05:59:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJwXy-0003tG-0k; Wed, 10 Mar 2021 05:58:34 -0500 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:39975) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJwXu-0000cO-C9; Wed, 10 Mar 2021 05:58:33 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id F13AD1740; Wed, 10 Mar 2021 05:58:27 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 10 Mar 2021 05:58:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=PNPkoOVJkRlgNDLz4OYprqd8fT7fbF22R4LkPE2zv iY=; b=SRKwhPc3MKKv2qf9Q6lB9iq0+pdYyaSmIi5eUkkOxMmL5vbIcSO6qvHoF WPirOCThToCayW+HaUH3/rE5FQ2pRxPappRLz9FA0/AKp8yDG7c7ZTszXI0ezVro aUGrhMkXyLV1dxDd4Vgcjai3JAdU9AgPcAabSgiku4cl/LZRRLDyLM9r8zIPvPl7 a0JlwDzeqK8KQsTTDDWirpaMA25Tdyw/ugJ2xbU985vgWdPcskpNZ2KczdX7HyFP q/2SuRBqQbGti97JAAdj56wOx2SJmY0M//8FuwC1rIy/fbzOGEUzB6uRe0CeiCl0 cMu+Y5uyDkIy3EBYQtZmRRlTdtlnw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddukedgvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepvffujghfhfffkfggtgfgsehtqhertddttdejnecuhfhrohhmpeffrghvihgu ucfgughmohhnughsohhnuceoughmvgesughmvgdrohhrgheqnecuggftrfgrthhtvghrnh epteevgeeuvedvjefhkefffeffveekvdekffehueeludfgteefheeljeetuddvkefhnecu kfhppeekuddrudekjedrvdeirddvfeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepughmvgesughmvgdrohhrgh X-ME-Proxy: Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net [81.187.26.238]) by mail.messagingengine.com (Postfix) with ESMTPA id 0336B24005A; Wed, 10 Mar 2021 05:58:25 -0500 (EST) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 06823673; Wed, 10 Mar 2021 10:58:25 +0000 (UTC) To: Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Subject: Re: [PATCH 4/9] hw/block/pflash_cfi02: Set rom_mode to true in pflash_setup_mappings() In-Reply-To: <20210309235028.912078-5-philmd@redhat.com> References: <20210309235028.912078-1-philmd@redhat.com> <20210309235028.912078-5-philmd@redhat.com> X-HGTTG: heart-of-gold From: David Edmondson Date: Wed, 10 Mar 2021 10:58:24 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: neutral client-ip=64.147.123.20; envelope-from=dme@dme.org; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NEUTRAL=0.779, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Stephen Checkoway , qemu-block@nongnu.org, Max Reitz , Alistair Francis , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Wednesday, 2021-03-10 at 00:50:23 +01, Philippe Mathieu-Daud=C3=A9 wrote: > There is only one call to pflash_setup_mappings(). Convert 'rom_mode' > to boolean and set it to true directly within pflash_setup_mappings(). > > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > --- > hw/block/pflash_cfi02.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c > index 845f50ed99b..5f949b4c792 100644 > --- a/hw/block/pflash_cfi02.c > +++ b/hw/block/pflash_cfi02.c > @@ -108,7 +108,7 @@ struct PFlashCFI02 { > MemoryRegion mem; > MemoryRegion *mem_mappings; /* array; one per mapping */ > MemoryRegion orig_mem; > - int rom_mode; > + bool rom_mode; Given this, doesn't the second argument to pflash_register_memory() need to change to bool, affecting its callers? > int read_counter; /* used for lazy switch-back to rom mode */ > int sectors_to_erase; > uint64_t erase_time_remaining; > @@ -181,6 +181,7 @@ static void pflash_setup_mappings(PFlashCFI02 *pfl) > "pflash-alias", &pfl->orig_mem, 0, size= ); > memory_region_add_subregion(&pfl->mem, i * size, &pfl->mem_mappi= ngs[i]); > } > + pfl->rom_mode =3D true; > } >=20=20 > static void pflash_register_memory(PFlashCFI02 *pfl, int rom_mode) > @@ -927,7 +928,6 @@ static void pflash_cfi02_realize(DeviceState *dev, Er= ror **errp) > pfl->sector_erase_map =3D bitmap_new(pfl->total_sectors); >=20=20 > pflash_setup_mappings(pfl); > - pfl->rom_mode =3D 1; > sysbus_init_mmio(SYS_BUS_DEVICE(dev), &pfl->mem); >=20=20 > timer_init_ns(&pfl->timer, QEMU_CLOCK_VIRTUAL, pflash_timer, pfl); > --=20 > 2.26.2 dme. --=20 And you can't hold me down, 'cause I belong to the hurricane.