Skip to contentSkip to conversation

hw/ide: Make "ide_internal.h" really internal

PATCH Superseded Philippe Mathieu-Daudé 4 participants 14 messages Feb 25, 2024 – Feb 26, 2024

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover hw/ide: Make "ide_internal.h" really internal

Since v1:
- Remove use of "ahci_internal.h" in SBSA-Ref
- Rename "internal.h" -> "ide_internal.h"

Supersedes: <[email protected]>

BALATON Zoltan (1):
hw/ide: Remove last two uses of ide/internal.h outside of hw/ide/

Philippe Mathieu-Daudé (2):
hw/arm/sbsa-ref: Do not open-code ahci_ide_create_devs() hw/ide: Include 'ide_internal.h' from current path

 hw/ide/ahci_internal.h                             |  2 +-
 include/hw/ide/internal.h => hw/ide/ide_internal.h |  0
 include/hw/misc/macio/macio.h                      |  2 +-
 hw/arm/sbsa-ref.c                                  | 11 ++---------
 hw/ide/ahci.c                                      |  2 +-
 hw/ide/atapi.c                                     |  2 +-
 hw/ide/cmd646.c                                    |  2 +-
 hw/ide/core.c                                      |  2 +-
 hw/ide/ide-bus.c                                   |  2 +-
 hw/ide/ide-dev.c                                   |  2 +-
 hw/ide/ioport.c                                    |  2 +-
 hw/ide/isa.c                                       |  2 +-
 hw/ide/macio.c                                     |  2 +-
 hw/ide/microdrive.c                                |  2 +-
 hw/ide/mmio.c                                      |  2 +-
 hw/ide/pci.c                                       |  2 +-
 hw/ide/piix.c                                      |  2 +-
 hw/ide/sii3112.c                                   |  2 +-
 hw/ide/via.c                                       |  2 +-
 19 files changed, 19 insertions(+), 26 deletions(-)
 rename include/hw/ide/internal.h => hw/ide/ide_internal.h (100%)
Signature · 1 line
2.41.0
#1 lore raw

PATCH v2 1/3 hw/arm/sbsa-ref: Do not open-code ahci_ide_create_devs()

Use ahci_ide_create_devs() instead of open-coding it. Not accessing AHCIDevice internals anymore allows to remove "hw/ide/ahci_internal.h" (which isn't really a public header).

---
 hw/arm/sbsa-ref.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
hw/arm/sbsa-ref.c +1 -8
index 5d3a574664..995c7be23e 100644
@@ -37,7 +37,6 @@
 #include "hw/block/flash.h"
 #include "hw/boards.h"
 #include "hw/ide/internal.h"
-#include "hw/ide/ahci_internal.h"
 #include "hw/ide/ahci-sysbus.h"
 #include "hw/intc/arm_gicv3_common.h"
 #include "hw/intc/arm_gicv3_its_common.h"
@@ -572,7 +571,6 @@ static void create_ahci(const SBSAMachineState *sms)
     DriveInfo *hd[NUM_SATA_PORTS];
     SysbusAHCIState *sysahci;
     AHCIState *ahci;
-    int i;
 
     dev = qdev_new("sysbus-ahci");
     qdev_prop_set_uint32(dev, "num-ports", NUM_SATA_PORTS);
@@ -583,12 +581,7 @@ static void create_ahci(const SBSAMachineState *sms)
     sysahci = SYSBUS_AHCI(dev);
     ahci = &sysahci->ahci;
     ide_drive_get(hd, ARRAY_SIZE(hd));
-    for (i = 0; i < ahci->ports; i++) {
-        if (hd[i] == NULL) {
-            continue;
-        }
-        ide_bus_create_drive(&ahci->dev[i].port, 0, hd[i]);
-    }
+    ahci_ide_create_devs(ahci, hd);
 }
 
 static void create_xhci(const SBSAMachineState *sms)
Signature · 1 line
2.41.0
#2 lore raw

Re: [PATCH v2 1/3] hw/arm/sbsa-ref: Do not open-code ahci_ide_create_devs()

Quoted 31 lines · Philippe Mathieu-Daudé

Use ahci_ide_create_devs() instead of open-coding it. Not accessing AHCIDevice internals anymore allows to remove "hw/ide/ahci_internal.h" (which isn't really a public header).

---
  hw/arm/sbsa-ref.c | 9 +--------
  1 file changed, 1 insertion(+), 8 deletions(-)
hw/arm/sbsa-ref.c +0 -2
index 5d3a574664..995c7be23e 100644
@@ -37,7 +37,6 @@
  #include "hw/block/flash.h"
  #include "hw/boards.h"
  #include "hw/ide/internal.h"
-#include "hw/ide/ahci_internal.h"
  #include "hw/ide/ahci-sysbus.h"
  #include "hw/intc/arm_gicv3_common.h"
  #include "hw/intc/arm_gicv3_its_common.h"
@@ -572,7 +571,6 @@ static void create_ahci(const SBSAMachineState *sms)
      DriveInfo *hd[NUM_SATA_PORTS];
      SysbusAHCIState *sysahci;
      AHCIState *ahci;
-    int i;
 
      dev = qdev_new("sysbus-ahci");
      qdev_prop_set_uint32(dev, "num-ports", NUM_SATA_PORTS);

hw/arm/sbsa-ref.c static void create_ahci(const SBSAMachineState *sms) · line 582

Quoted 2 lines
hw/arm/sbsa-ref.c +0 -0
@@ -583,12 +581,7 @@ static void create_ahci(const SBSAMachineState *sms)
      sysahci = SYSBUS_AHCI(dev);
      ahci = &sysahci->ahci;

Bah, we can even remove that 'ahci' variable.

hw/arm/sbsa-ref.c static void create_ahci(const SBSAMachineState *sms) · line 585

Quoted 9 lines
hw/arm/sbsa-ref.c +1 -6
      ide_drive_get(hd, ARRAY_SIZE(hd));
-    for (i = 0; i < ahci->ports; i++) {
-        if (hd[i] == NULL) {
-            continue;
-        }
-        ide_bus_create_drive(&ahci->dev[i].port, 0, hd[i]);
-    }
+    ahci_ide_create_devs(ahci, hd);
  }

-- >8 --
@@ -571,8 +570,6 @@ static void create_ahci(const SBSAMachineState *sms)

     DeviceState *dev;
     DriveInfo *hd[NUM_SATA_PORTS];
     SysbusAHCIState *sysahci;

- AHCIState *ahci;
- int i;

     dev = qdev_new("sysbus-ahci");
     qdev_prop_set_uint32(dev, "num-ports", NUM_SATA_PORTS);

@@ -581,14 +578,8 @@ static void create_ahci(const SBSAMachineState *sms)
sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0,
qdev_get_gpio_in(sms->gic, irq));

     sysahci = SYSBUS_AHCI(dev);
-    ahci = &sysahci->ahci;
     ide_drive_get(hd, ARRAY_SIZE(hd));

- for (i = 0; i < ahci->ports; i++) {
- if (hd[i] == NULL) {
- continue;
- }
- ide_bus_create_drive(&ahci->dev[i].port, 0, hd[i]);
- }
+ ahci_ide_create_devs(&sysahci->ahci, hd);
}
---

Reviewed-by
#3 lore raw

Re: [PATCH v2 1/3] hw/arm/sbsa-ref: Do not open-code ahci_ide_create_devs()

Quoted 61 lines · Philippe Mathieu-Daudé
Quoted 30 lines · Philippe Mathieu-Daudé

Use ahci_ide_create_devs() instead of open-coding it. Not accessing AHCIDevice internals anymore allows to remove "hw/ide/ahci_internal.h" (which isn't really a public header).

---
  hw/arm/sbsa-ref.c | 9 +--------

  1 file changed, 1 insertion(+), 8 deletions(-)
hw/arm/sbsa-ref.c +0 -2
index 5d3a574664..995c7be23e 100644
@@ -37,7 +37,6 @@
   #include "hw/block/flash.h"
   #include "hw/boards.h"
   #include "hw/ide/internal.h"
-#include "hw/ide/ahci_internal.h"
   #include "hw/ide/ahci-sysbus.h"
   #include "hw/intc/arm_gicv3_common.h"
   #include "hw/intc/arm_gicv3_its_common.h"
@@ -572,7 +571,6 @@ static void create_ahci(const SBSAMachineState *sms)
       DriveInfo *hd[NUM_SATA_PORTS];
       SysbusAHCIState *sysahci;
       AHCIState *ahci;
-    int i;
       dev = qdev_new("sysbus-ahci");
       qdev_prop_set_uint32(dev, "num-ports", NUM_SATA_PORTS);

hw/arm/sbsa-ref.c static void create_ahci(const SBSAMachineState *sms) · line 582

Quoted 2 lines
hw/arm/sbsa-ref.c +0 -0
@@ -583,12 +581,7 @@ static void create_ahci(const SBSAMachineState *sms)
       sysahci = SYSBUS_AHCI(dev);
       ahci = &sysahci->ahci;

Bah, we can even remove that 'ahci' variable.

hw/arm/sbsa-ref.c static void create_ahci(const SBSAMachineState *sms) · line 585

Quoted 9 lines
hw/arm/sbsa-ref.c +1 -6
       ide_drive_get(hd, ARRAY_SIZE(hd));
-    for (i = 0; i < ahci->ports; i++) {
-        if (hd[i] == NULL) {
-            continue;
-        }
-        ide_bus_create_drive(&ahci->dev[i].port, 0, hd[i]);
-    }
+    ahci_ide_create_devs(ahci, hd);
   }

-- >8 --

hw/arm/sbsa-ref.c +0 -2
@@ -571,8 +570,6 @@ static void create_ahci(const SBSAMachineState *sms)
      DeviceState *dev;
      DriveInfo *hd[NUM_SATA_PORTS];
      SysbusAHCIState *sysahci;
-    AHCIState *ahci;
-    int i;
 
      dev = qdev_new("sysbus-ahci");
      qdev_prop_set_uint32(dev, "num-ports", NUM_SATA_PORTS);
@@ -581,14 +578,8 @@ static void create_ahci(const SBSAMachineState *sms)
      sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, qdev_get_gpio_in(sms->gic, 
 irq));
 
      sysahci = SYSBUS_AHCI(dev);

hw/arm/sbsa-ref.c static void create_ahci(const SBSAMachineState *sms) · line 584

Quoted 10 lines
hw/arm/sbsa-ref.c +1 -7
-    ahci = &sysahci->ahci;
      ide_drive_get(hd, ARRAY_SIZE(hd));
-    for (i = 0; i < ahci->ports; i++) {
-        if (hd[i] == NULL) {
-            continue;
-        }
-        ide_bus_create_drive(&ahci->dev[i].port, 0, hd[i]);
-    }
+    ahci_ide_create_devs(&sysahci->ahci, hd);
  }
#4 lore raw

PATCH v2 2/3 hw/ide: Remove last two uses of ide/internal.h outside of hw/ide/

In reply to Philippe Mathieu-Daudé

From: BALATON Zoltan <[email protected]>

Remove last two includes of hw/ide/intarnal.h outside of hw/ide and replace them with newly added public header to allow moving internal.h into hw/ide to really stop exposing it.

Fixes a11f439a0e (hw/ide: Stop exposing internal.h to non-IDE files)

Message-ID: <[email protected]>

---
 {include/hw => hw}/ide/internal.h | 0
 include/hw/misc/macio/macio.h     | 2 +-
 hw/arm/sbsa-ref.c                 | 2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename {include/hw => hw}/ide/internal.h (100%)
hw/ide/internal.h renamed from include/hw/ide/internal.h +0 -0
similarity index 100%
rename from include/hw/ide/internal.h
rename to hw/ide/internal.h
include/hw/misc/macio/macio.h +1 -1
index 86df2c2b60..2b54da6b31 100644
@@ -28,7 +28,7 @@
 
 #include "hw/char/escc.h"
 #include "hw/pci/pci_device.h"
-#include "hw/ide/internal.h"
+#include "hw/ide/ide-bus.h"
 #include "hw/intc/heathrow_pic.h"
 #include "hw/misc/macio/cuda.h"
 #include "hw/misc/macio/gpio.h"
hw/arm/sbsa-ref.c +1 -1
index 995c7be23e..aa1eeecc94 100644
@@ -36,7 +36,7 @@
 #include "hw/arm/smmuv3.h"
 #include "hw/block/flash.h"
 #include "hw/boards.h"
-#include "hw/ide/internal.h"
+#include "hw/ide/ide-bus.h"
 #include "hw/ide/ahci-sysbus.h"
 #include "hw/intc/arm_gicv3_common.h"
 #include "hw/intc/arm_gicv3_its_common.h"
Signature · 1 line
2.41.0
#5 lore raw

PATCH v2 3/3 hw/ide: Include 'ide_internal.h' from current path

In reply to Philippe Mathieu-Daudé

Rename "internal.h" as "ide_internal.h", and include it via its relative local path, instead of absolute to the project root path.

Mechanical patch doing:

  $ sed -i -e 's#hw/ide/internal.h#ide_internal.h#' \
        $(git grep -l hw/ide/internal)
  $ git mv hw/ide/internal.h hw/ide/ide_internal.h
---
 hw/ide/ahci_internal.h                | 2 +-
 hw/ide/{internal.h => ide_internal.h} | 0
 hw/ide/ahci.c                         | 2 +-
 hw/ide/atapi.c                        | 2 +-
 hw/ide/cmd646.c                       | 2 +-
 hw/ide/core.c                         | 2 +-
 hw/ide/ide-bus.c                      | 2 +-
 hw/ide/ide-dev.c                      | 2 +-
 hw/ide/ioport.c                       | 2 +-
 hw/ide/isa.c                          | 2 +-
 hw/ide/macio.c                        | 2 +-
 hw/ide/microdrive.c                   | 2 +-
 hw/ide/mmio.c                         | 2 +-
 hw/ide/pci.c                          | 2 +-
 hw/ide/piix.c                         | 2 +-
 hw/ide/sii3112.c                      | 2 +-
 hw/ide/via.c                          | 2 +-
 17 files changed, 16 insertions(+), 16 deletions(-)
 rename hw/ide/{internal.h => ide_internal.h} (100%)
hw/ide/ahci_internal.h +1 -1
index 4e13329bb2..34f3d50ca9 100644
@@ -25,7 +25,7 @@
 #define HW_IDE_AHCI_INTERNAL_H
 
 #include "hw/ide/ahci.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/pci/pci_device.h"
 
 #define AHCI_MEM_BAR_SIZE         0x1000
hw/ide/ide_internal.h renamed from hw/ide/internal.h +0 -0
similarity index 100%
rename from hw/ide/internal.h
rename to hw/ide/ide_internal.h
hw/ide/ahci.c +1 -1
index 54c9685495..c2af344ac5 100644
@@ -34,7 +34,7 @@
 #include "qemu/module.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/ide/pci.h"
 #include "hw/ide/ahci-pci.h"
 #include "hw/ide/ahci-sysbus.h"
hw/ide/atapi.c +1 -1
index dcc39df9a4..8ac99f64d2 100644
@@ -24,7 +24,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/scsi/scsi.h"
 #include "sysemu/block-backend.h"
 #include "scsi/constants.h"
hw/ide/cmd646.c +1 -1
index 23d213ff01..be72f4d3ed 100644
@@ -33,7 +33,7 @@
 #include "sysemu/reset.h"
 
 #include "hw/ide/pci.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "trace.h"
 
 /* CMD646 specific */
hw/ide/core.c +1 -1
index 9c4a812902..8f2004f93b 100644
@@ -41,7 +41,7 @@
 #include "qemu/cutils.h"
 #include "sysemu/replay.h"
 #include "sysemu/runstate.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "trace.h"
 
 /* These values were based on a Seagate ST3500418AS but have been modified
hw/ide/ide-bus.c +1 -1
index 57fe67b29c..32e9f62137 100644
@@ -21,7 +21,7 @@
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/runstate.h"
hw/ide/ide-dev.c +1 -1
index c8e2033469..832293ca69 100644
@@ -23,7 +23,7 @@
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "hw/ide/ide-dev.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/sysemu.h"
hw/ide/ioport.c +1 -1
index 0b283ac783..7a80c549ec 100644
@@ -25,7 +25,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/isa/isa.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "trace.h"
 
 int ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2)
hw/ide/isa.c +1 -1
index cc865c83dc..2fc28d64b6 100644
@@ -32,7 +32,7 @@
 #include "sysemu/dma.h"
 
 #include "hw/ide/isa.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "qom/object.h"
 
 /***********************************************************/
hw/ide/macio.c +1 -1
index 0d2c6ba910..7611a99ef5 100644
@@ -33,7 +33,7 @@
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
 
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 
 /* debug MACIO */
 // #define DEBUG_MACIO
hw/ide/microdrive.c +1 -1
index a7f415f0fc..09781658f9 100644
@@ -31,7 +31,7 @@
 #include "sysemu/dma.h"
 #include "hw/irq.h"
 
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "qom/object.h"
 
 #define TYPE_MICRODRIVE "microdrive"
hw/ide/mmio.c +1 -1
index e8f41c0610..1ba2541b40 100644
@@ -30,7 +30,7 @@
 #include "sysemu/dma.h"
 
 #include "hw/ide/mmio.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/qdev-properties.h"
 
 /***********************************************************/
hw/ide/pci.c +1 -1
index 73efeec7f4..855cbb031d 100644
@@ -30,7 +30,7 @@
 #include "sysemu/dma.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/ide/pci.h"
 #include "trace.h"
 
hw/ide/piix.c +1 -1
index 1773a068c3..886cf840f1 100644
@@ -30,7 +30,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/pci/pci.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/ide/piix.h"
 #include "hw/ide/pci.h"
 #include "trace.h"
hw/ide/sii3112.c +1 -1
index 321b9e46a1..e28bbd160d 100644
@@ -13,7 +13,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/ide/pci.h"
 #include "qemu/module.h"
 #include "trace.h"
hw/ide/via.c +1 -1
index cf151e70ec..ceecb3aa01 100644
@@ -25,7 +25,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/pci/pci.h"
 #include "migration/vmstate.h"
 #include "qemu/module.h"
Signature · 1 line
2.41.0
#6 lore raw

Re: [PATCH v2 3/3] hw/ide: Include 'ide_internal.h' from current path

Quoted 1 line · Philippe Mathieu-Daudé

Rename "internal.h" as "ide_internal.h", and include

Is there a convention about using underscore or dash in file names? The headers Thomas added are using - as well as ahci-allwinner.c, only ahci_internal.h has _ (but there are others elsewhere such as pci_device.h). Maybe we should be consistent at least within IDE and this series is now a good opportunity for renaming these headers to match. But it's just a small nit, thanks for picking this up.

Regards,
BALATON Zoltan

Quoted 244 lines

it via its relative local path, instead of absolute to the project root path.

Mechanical patch doing:

 $ sed -i -e 's#hw/ide/internal.h#ide_internal.h#' \
       $(git grep -l hw/ide/internal)
 $ git mv hw/ide/internal.h hw/ide/ide_internal.h

---

hw/ide/ahci_internal.h                | 2 +-
hw/ide/{internal.h => ide_internal.h} | 0
hw/ide/ahci.c                         | 2 +-
hw/ide/atapi.c                        | 2 +-
hw/ide/cmd646.c                       | 2 +-
hw/ide/core.c                         | 2 +-
hw/ide/ide-bus.c                      | 2 +-
hw/ide/ide-dev.c                      | 2 +-
hw/ide/ioport.c                       | 2 +-
hw/ide/isa.c                          | 2 +-
hw/ide/macio.c                        | 2 +-
hw/ide/microdrive.c                   | 2 +-
hw/ide/mmio.c                         | 2 +-
hw/ide/pci.c                          | 2 +-
hw/ide/piix.c                         | 2 +-
hw/ide/sii3112.c                      | 2 +-
hw/ide/via.c                          | 2 +-
17 files changed, 16 insertions(+), 16 deletions(-)

rename hw/ide/{internal.h => ide_internal.h} (100%)

hw/ide/ahci_internal.h +1 -1
index 4e13329bb2..34f3d50ca9 100644
@@ -25,7 +25,7 @@
 #define HW_IDE_AHCI_INTERNAL_H
 
 #include "hw/ide/ahci.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/pci/pci_device.h"
 
 #define AHCI_MEM_BAR_SIZE         0x1000
hw/ide/ide_internal.h renamed from hw/ide/internal.h +0 -0
similarity index 100%
rename from hw/ide/internal.h
rename to hw/ide/ide_internal.h
hw/ide/ahci.c +1 -1
index 54c9685495..c2af344ac5 100644
@@ -34,7 +34,7 @@
 #include "qemu/module.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/ide/pci.h"
 #include "hw/ide/ahci-pci.h"
 #include "hw/ide/ahci-sysbus.h"
hw/ide/atapi.c +1 -1
index dcc39df9a4..8ac99f64d2 100644
@@ -24,7 +24,7 @@
 */
 
 #include "qemu/osdep.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/scsi/scsi.h"
 #include "sysemu/block-backend.h"
 #include "scsi/constants.h"
hw/ide/cmd646.c +1 -1
index 23d213ff01..be72f4d3ed 100644
@@ -33,7 +33,7 @@
 #include "sysemu/reset.h"
 
 #include "hw/ide/pci.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "trace.h"
 
 /* CMD646 specific */
hw/ide/core.c +1 -1
index 9c4a812902..8f2004f93b 100644
@@ -41,7 +41,7 @@
 #include "qemu/cutils.h"
 #include "sysemu/replay.h"
 #include "sysemu/runstate.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "trace.h"
 
 /* These values were based on a Seagate ST3500418AS but have been modified
hw/ide/ide-bus.c +1 -1
index 57fe67b29c..32e9f62137 100644
@@ -21,7 +21,7 @@
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/runstate.h"
hw/ide/ide-dev.c +1 -1
index c8e2033469..832293ca69 100644
@@ -23,7 +23,7 @@
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "hw/ide/ide-dev.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/sysemu.h"
hw/ide/ioport.c +1 -1
index 0b283ac783..7a80c549ec 100644
@@ -25,7 +25,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/isa/isa.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "trace.h"
 
 int ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2)
hw/ide/isa.c +1 -1
index cc865c83dc..2fc28d64b6 100644
@@ -32,7 +32,7 @@
 #include "sysemu/dma.h"
 
 #include "hw/ide/isa.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "qom/object.h"
 
 /***********************************************************/
hw/ide/macio.c +1 -1
index 0d2c6ba910..7611a99ef5 100644
@@ -33,7 +33,7 @@
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
 
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 
 /* debug MACIO */
 // #define DEBUG_MACIO
hw/ide/microdrive.c +1 -1
index a7f415f0fc..09781658f9 100644
@@ -31,7 +31,7 @@
 #include "sysemu/dma.h"
 #include "hw/irq.h"
 
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "qom/object.h"
 
 #define TYPE_MICRODRIVE "microdrive"
hw/ide/mmio.c +1 -1
index e8f41c0610..1ba2541b40 100644
@@ -30,7 +30,7 @@
 #include "sysemu/dma.h"
 
 #include "hw/ide/mmio.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/qdev-properties.h"
 
 /***********************************************************/
hw/ide/pci.c +1 -1
index 73efeec7f4..855cbb031d 100644
@@ -30,7 +30,7 @@
 #include "sysemu/dma.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/ide/pci.h"
 #include "trace.h"
 
hw/ide/piix.c +1 -1
index 1773a068c3..886cf840f1 100644
@@ -30,7 +30,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/pci/pci.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/ide/piix.h"
 #include "hw/ide/pci.h"
 #include "trace.h"
hw/ide/sii3112.c +1 -1
index 321b9e46a1..e28bbd160d 100644
@@ -13,7 +13,7 @@
 */
 
 #include "qemu/osdep.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/ide/pci.h"
 #include "qemu/module.h"
 #include "trace.h"
hw/ide/via.c +1 -1
index cf151e70ec..ceecb3aa01 100644
@@ -25,7 +25,7 @@
 */
 
 #include "qemu/osdep.h"
-#include "hw/ide/internal.h"
+#include "ide_internal.h"
 #include "hw/pci/pci.h"
 #include "migration/vmstate.h"
 #include "qemu/module.h"
#7 lore raw

Re: [PATCH v2 3/3] hw/ide: Include 'ide_internal.h' from current path

Quoted 4 lines · BALATON Zoltan
Quoted 1 line · Philippe Mathieu-Daudé

Rename "internal.h" as "ide_internal.h", and include

Is there a convention about using underscore or dash in file names? The headers Thomas added are using - as well as ahci-allwinner.c, only ahci_internal.h has _ (but there are others elsewhere such as pci_device.h). Maybe we should be consistent at least within IDE and this series is now a good opportunity for renaming these headers to match. But it's just a small nit, thanks for picking this up.

This is one of the many unnecessary inconsistencies we're inflicting on ourselves.

We have more than 3600 file names containing '-', and more almost 2700 containing '_'. Bizarrely, 68 of them contain both.

I strongly prefer '_' myself.

Zoltan is making a local consistency argument for '-'.

Let's use '-' here.

#8 lore raw

Re: [PATCH v2 3/3] hw/ide: Include 'ide_internal.h' from current path

Quoted 10 lines · Markus Armbruster
Quoted 4 lines · BALATON Zoltan
Quoted 1 line · Philippe Mathieu-Daudé

Rename "internal.h" as "ide_internal.h", and include

Is there a convention about using underscore or dash in file names? The headers Thomas added are using - as well as ahci-allwinner.c, only ahci_internal.h has _ (but there are others elsewhere such as pci_device.h). Maybe we should be consistent at least within IDE and this series is now a good opportunity for renaming these headers to match. But it's just a small nit, thanks for picking this up.

This is one of the many unnecessary inconsistencies we're inflicting on ourselves.

Quoted 8 lines

We have more than 3600 file names containing '-', and more almost 2700 containing '_'. Bizarrely, 68 of them contain both.

I strongly prefer '_' myself.

Zoltan is making a local consistency argument for '-'.

Let's use '-' here.

Fine, patch updated.

#9 lore raw

Re: [PATCH v2 3/3] hw/ide: Include 'ide_internal.h' from current path

Quoted 11 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Markus Armbruster
Quoted 4 lines · BALATON Zoltan
Quoted 1 line · Philippe Mathieu-Daudé

Rename "internal.h" as "ide_internal.h", and include

Is there a convention about using underscore or dash in file names? The headers Thomas added are using - as well as ahci-allwinner.c, only ahci_internal.h has _ (but there are others elsewhere such as pci_device.h). Maybe we should be consistent at least within IDE and this series is now a good opportunity for renaming these headers to match. But it's just a small nit, thanks for picking this up.

This is one of the many unnecessary inconsistencies we're inflicting on ourselves.

Quoted 8 lines
Quoted 8 lines

We have more than 3600 file names containing '-', and more almost 2700 containing '_'.  Bizarrely, 68 of them contain both.

I strongly prefer '_' myself.

Zoltan is making a local consistency argument for '-'.

Let's use '-' here.

BTW by "here" I understood "in this patch". After v3 only a single file use '_': "ahci_internal.h", but Zoltan said he is uninterested and doesn't care about it so I'm not renaming it.
(https://lore.kernel.org/qemu-devel/[email protected]/)

Quoted 3 lines

Fine, patch updated.

#10 lore raw

Re: [PATCH v2 3/3] hw/ide: Include 'ide_internal.h' from current path

Quoted 17 lines · Philippe Mathieu-Daudé
Quoted 16 lines · Philippe Mathieu-Daudé
Quoted 15 lines · Markus Armbruster
Quoted 4 lines · BALATON Zoltan
Quoted 1 line · Philippe Mathieu-Daudé

Rename "internal.h" as "ide_internal.h", and include

Is there a convention about using underscore or dash in file names? The headers Thomas added are using - as well as ahci-allwinner.c, only ahci_internal.h has _ (but there are others elsewhere such as pci_device.h). Maybe we should be consistent at least within IDE and this series is now a good opportunity for renaming these headers to match. But it's just a small nit, thanks for picking this up.

This is one of the many unnecessary inconsistencies we're inflicting on ourselves.

We have more than 3600 file names containing '-', and more almost 2700 containing '_'.  Bizarrely, 68 of them contain both.

I strongly prefer '_' myself.

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

Zoltan is making a local consistency argument for '-'.

Let's use '-' here.

BTW by "here" I understood "in this patch". After v3 only a single file use '_': "ahci_internal.h", but Zoltan said he is uninterested and doesn't care about it so I'm not renaming it.
(https://lore.kernel.org/qemu-devel/[email protected]/)

Yes, I don't care and also prefer _ in file names but since all the other headers use - now it's simpler to make all of them the same just for consistency so I've meant to rename ahci_internal.h too but forgot to mention it explikcitly. Sorry for that.

Regards,
BALATON Zoltan

#11 lore raw

Re: [PATCH v2 3/3] hw/ide: Include 'ide_internal.h' from current path

In reply to Philippe Mathieu-Daudé
Quoted 14 lines · Philippe Mathieu-Daudé
Quoted 13 lines · Markus Armbruster
Quoted 4 lines · BALATON Zoltan
Quoted 1 line · Philippe Mathieu-Daudé

Rename "internal.h" as "ide_internal.h", and include

Is there a convention about using underscore or dash in file names? The headers Thomas added are using - as well as ahci-allwinner.c, only ahci_internal.h has _ (but there are others elsewhere such as pci_device.h). Maybe we should be consistent at least within IDE and this series is now a good opportunity for renaming these headers to match. But it's just a small nit, thanks for picking this up.

This is one of the many unnecessary inconsistencies we're inflicting on ourselves.

We have more than 3600 file names containing '-', and more almost 2700 containing '_'. Bizarrely, 68 of them contain both.

Quoted 7 lines
Quoted 5 lines

I strongly prefer '_' myself.

Zoltan is making a local consistency argument for '-'.

Let's use '-' here.

Fine, patch updated.

And then please also rename ahci_internal.h to use '-' to be really consistent.

Regards,
BALATON Zoltan

#12 lore raw

Re: [PATCH v2 3/3] hw/ide: Include 'ide_internal.h' from current path

Quoted 17 lines · BALATON Zoltan
Quoted 16 lines · Philippe Mathieu-Daudé
Quoted 15 lines · Markus Armbruster
Quoted 4 lines · BALATON Zoltan
Quoted 1 line · Philippe Mathieu-Daudé

Rename "internal.h" as "ide_internal.h", and include

Is there a convention about using underscore or dash in file names? The headers Thomas added are using - as well as ahci-allwinner.c, only ahci_internal.h has _ (but there are others elsewhere such as pci_device.h). Maybe we should be consistent at least within IDE and this series is now a good opportunity for renaming these headers to match. But it's just a small nit, thanks for picking this up.

This is one of the many unnecessary inconsistencies we're inflicting on ourselves.

We have more than 3600 file names containing '-', and more almost 2700 containing '_'.  Bizarrely, 68 of them contain both.

I strongly prefer '_' myself.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Zoltan is making a local consistency argument for '-'.

Let's use '-' here.

Fine, patch updated.

And then please also rename ahci_internal.h to use '-' to be really consistent.

I'm sorry but I don't have time. Maybe fill a ByteSized task?

#13 lore raw

Re: [PATCH v2 3/3] hw/ide: Include 'ide_internal.h' from current path

Quoted 20 lines · Philippe Mathieu-Daudé
Quoted 19 lines · BALATON Zoltan
Quoted 18 lines · Philippe Mathieu-Daudé
Quoted 17 lines · Markus Armbruster
Quoted 4 lines · BALATON Zoltan
Quoted 1 line · Philippe Mathieu-Daudé

Rename "internal.h" as "ide_internal.h", and include

Is there a convention about using underscore or dash in file names? The headers Thomas added are using - as well as ahci-allwinner.c, only ahci_internal.h has _ (but there are others elsewhere such as pci_device.h). Maybe we should be consistent at least within IDE and this series is now a good opportunity for renaming these headers to match. But it's just a small nit, thanks for picking this up.

This is one of the many unnecessary inconsistencies we're inflicting on ourselves.

We have more than 3600 file names containing '-', and more almost 2700 containing '_'.  Bizarrely, 68 of them contain both.

I strongly prefer '_' myself.

Zoltan is making a local consistency argument for '-'.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Let's use '-' here.

Fine, patch updated.

And then please also rename ahci_internal.h to use '-' to be really consistent.

I'm sorry but I don't have time. Maybe fill a ByteSized task?

No problem, just noted in case you'd respin it for some other reason. Otherwise somebody can send a patch later.

Regards,
BALATON Zoltan