qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 01/21] hw/block: Rename TYPE_PFLASH_CFI02 'width' property


From: BALATON Zoltan
Subject: Re: [PATCH v2 01/21] hw/block: Rename TYPE_PFLASH_CFI02 'width' property as 'device-width'
Date: Mon, 9 Jan 2023 15:18:15 +0100 (CET)

On Mon, 9 Jan 2023, Philippe Mathieu-Daudé wrote:
On 9/1/23 14:33, BALATON Zoltan wrote:
On Mon, 9 Jan 2023, Philippe Mathieu-Daudé wrote:
Use the same property name than the TYPE_PFLASH_CFI01 model.

Nothing uses it? Can this break command lines and if so do we need deprecation or some compatibility function until everybody changed their usage?

Good point... I missed that :/

How deprecation works in that case, can I simply add an extra
property with DEFINE_PROP_UINT8()? I'm worried about an user
doing:

-device cfi.pflash02,device-width=4,width=2,...

Or maybe just leave it alone to avoid further problems. Cfi02 only has width and 4 sector lengths with corresponding sizes, while cfi01 has width, device-width and max-device-width so these just seem to be describing geometry differently so maybe no need to try to use same property names. Width is also shorter than device-width so I'd keep that for brevity.

Regards,
BALATON Zoltan

and the processing order of the properties, besides property
overwritten isn't warned to the user.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
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 2a99b286b0..55ddd0916c 100644
--- a/hw/block/pflash_cfi02.c
+++ b/hw/block/pflash_cfi02.c
@@ -949,7 +949,7 @@ static Property pflash_cfi02_properties[] = {
    DEFINE_PROP_UINT32("sector-length2", PFlashCFI02, sector_len[2], 0),
    DEFINE_PROP_UINT32("num-blocks3", PFlashCFI02, nb_blocs[3], 0),
    DEFINE_PROP_UINT32("sector-length3", PFlashCFI02, sector_len[3], 0),
-    DEFINE_PROP_UINT8("width", PFlashCFI02, width, 0),
+    DEFINE_PROP_UINT8("device-width", PFlashCFI02, width, 0),
    DEFINE_PROP_UINT8("mappings", PFlashCFI02, mappings, 0),
    DEFINE_PROP_UINT8("big-endian", PFlashCFI02, be, 0),
    DEFINE_PROP_UINT16("id0", PFlashCFI02, ident0, 0),
@@ -1014,7 +1014,7 @@ PFlashCFI02 *pflash_cfi02_register(hwaddr base,
    assert(QEMU_IS_ALIGNED(size, sector_len));
    qdev_prop_set_uint32(dev, "num-blocks", size / sector_len);
    qdev_prop_set_uint32(dev, "sector-length", sector_len);
-    qdev_prop_set_uint8(dev, "width", width);
+    qdev_prop_set_uint8(dev, "device-width", width);
    qdev_prop_set_uint8(dev, "mappings", nb_mappings);
    qdev_prop_set_uint8(dev, "big-endian", !!be);
    qdev_prop_set_uint16(dev, "id0", id0);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]