diff mbox series

[v2,6/7] hw/ide: Move MAX_IDE_DEVS define to hw/ide/internal.h

Message ID 2abde3829a94acf0aa90942794ff0c4b03c653f4.1584437958.git.balaton@eik.bme.hu (mailing list archive)
State New, archived
Headers show
Series Misc hw/ide legacy clean up | expand

Commit Message

BALATON Zoltan March 17, 2020, 9:39 a.m. UTC
We can move this define now that less files use it to internal.h to
further reduce dependency on hw/ide.h.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
---
 include/hw/ide.h          | 2 --
 include/hw/ide/internal.h | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

John Snow March 17, 2020, 2:22 p.m. UTC | #1
On 3/17/20 5:39 AM, BALATON Zoltan wrote:
> We can move this define now that less files use it to internal.h to
> further reduce dependency on hw/ide.h.
> 
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> ---
>  include/hw/ide.h          | 2 --
>  include/hw/ide/internal.h | 2 ++
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/hw/ide.h b/include/hw/ide.h
> index d52c211f32..c5ce5da4f4 100644
> --- a/include/hw/ide.h
> +++ b/include/hw/ide.h
> @@ -4,8 +4,6 @@
>  #include "hw/isa/isa.h"
>  #include "exec/memory.h"
>  
> -#define MAX_IDE_DEVS	2
> -
>  /* ide-isa.c */
>  ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq,
>                          DriveInfo *hd0, DriveInfo *hd1);
> diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h
> index 1bc1fc73e5..55da35d768 100644
> --- a/include/hw/ide/internal.h
> +++ b/include/hw/ide/internal.h
> @@ -27,6 +27,8 @@ typedef struct IDEDMAOps IDEDMAOps;
>  #define TYPE_IDE_BUS "IDE"
>  #define IDE_BUS(obj) OBJECT_CHECK(IDEBus, (obj), TYPE_IDE_BUS)
>  
> +#define MAX_IDE_DEVS 2
> +
>  /* Bits of HD_STATUS */
>  #define ERR_STAT		0x01
>  #define INDEX_STAT		0x02
> 

/home/jsnow/src/qemu.git/ide/hw/mips/mips_r4k.c: In function
‘mips_r4k_init’:
/home/jsnow/src/qemu.git/ide/hw/mips/mips_r4k.c:190:33: error:
‘MAX_IDE_DEVS’ undeclared (first use in this function); did you mean
‘MAX_IDE_BUS’?
  190 |     DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
      |                                 ^~~~~~~~~~~~
      |                                 MAX_IDE_BUS



Missed a spot.

--js
BALATON Zoltan March 17, 2020, 2:24 p.m. UTC | #2
On Tue, 17 Mar 2020, John Snow wrote:
> On 3/17/20 5:39 AM, BALATON Zoltan wrote:
>> We can move this define now that less files use it to internal.h to
>> further reduce dependency on hw/ide.h.
>>
>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  include/hw/ide.h          | 2 --
>>  include/hw/ide/internal.h | 2 ++
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/hw/ide.h b/include/hw/ide.h
>> index d52c211f32..c5ce5da4f4 100644
>> --- a/include/hw/ide.h
>> +++ b/include/hw/ide.h
>> @@ -4,8 +4,6 @@
>>  #include "hw/isa/isa.h"
>>  #include "exec/memory.h"
>>
>> -#define MAX_IDE_DEVS	2
>> -
>>  /* ide-isa.c */
>>  ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq,
>>                          DriveInfo *hd0, DriveInfo *hd1);
>> diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h
>> index 1bc1fc73e5..55da35d768 100644
>> --- a/include/hw/ide/internal.h
>> +++ b/include/hw/ide/internal.h
>> @@ -27,6 +27,8 @@ typedef struct IDEDMAOps IDEDMAOps;
>>  #define TYPE_IDE_BUS "IDE"
>>  #define IDE_BUS(obj) OBJECT_CHECK(IDEBus, (obj), TYPE_IDE_BUS)
>>
>> +#define MAX_IDE_DEVS 2
>> +
>>  /* Bits of HD_STATUS */
>>  #define ERR_STAT		0x01
>>  #define INDEX_STAT		0x02
>>
>
> /home/jsnow/src/qemu.git/ide/hw/mips/mips_r4k.c: In function
> ‘mips_r4k_init’:
> /home/jsnow/src/qemu.git/ide/hw/mips/mips_r4k.c:190:33: error:
> ‘MAX_IDE_DEVS’ undeclared (first use in this function); did you mean
> ‘MAX_IDE_BUS’?
>  190 |     DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
>      |                                 ^~~~~~~~~~~~
>      |                                 MAX_IDE_BUS
>
>
>
> Missed a spot.

Probably due to dropping patch 4, I'll check and send a v3. Is there 
anything else besides Philippe's suggestion?

Regards,
BALATON Zoltan
John Snow March 17, 2020, 2:27 p.m. UTC | #3
On 3/17/20 10:24 AM, BALATON Zoltan wrote:
> On Tue, 17 Mar 2020, John Snow wrote:
>> On 3/17/20 5:39 AM, BALATON Zoltan wrote:
>>> We can move this define now that less files use it to internal.h to
>>> further reduce dependency on hw/ide.h.
>>>
>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>>> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>>> ---
>>>  include/hw/ide.h          | 2 --
>>>  include/hw/ide/internal.h | 2 ++
>>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/include/hw/ide.h b/include/hw/ide.h
>>> index d52c211f32..c5ce5da4f4 100644
>>> --- a/include/hw/ide.h
>>> +++ b/include/hw/ide.h
>>> @@ -4,8 +4,6 @@
>>>  #include "hw/isa/isa.h"
>>>  #include "exec/memory.h"
>>>
>>> -#define MAX_IDE_DEVS    2
>>> -
>>>  /* ide-isa.c */
>>>  ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int
>>> isairq,
>>>                          DriveInfo *hd0, DriveInfo *hd1);
>>> diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h
>>> index 1bc1fc73e5..55da35d768 100644
>>> --- a/include/hw/ide/internal.h
>>> +++ b/include/hw/ide/internal.h
>>> @@ -27,6 +27,8 @@ typedef struct IDEDMAOps IDEDMAOps;
>>>  #define TYPE_IDE_BUS "IDE"
>>>  #define IDE_BUS(obj) OBJECT_CHECK(IDEBus, (obj), TYPE_IDE_BUS)
>>>
>>> +#define MAX_IDE_DEVS 2
>>> +
>>>  /* Bits of HD_STATUS */
>>>  #define ERR_STAT        0x01
>>>  #define INDEX_STAT        0x02
>>>
>>
>> /home/jsnow/src/qemu.git/ide/hw/mips/mips_r4k.c: In function
>> ‘mips_r4k_init’:
>> /home/jsnow/src/qemu.git/ide/hw/mips/mips_r4k.c:190:33: error:
>> ‘MAX_IDE_DEVS’ undeclared (first use in this function); did you mean
>> ‘MAX_IDE_BUS’?
>>  190 |     DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
>>      |                                 ^~~~~~~~~~~~
>>      |                                 MAX_IDE_BUS
>>
>>
>>
>> Missed a spot.
> 
> Probably due to dropping patch 4, I'll check and send a v3. Is there
> anything else besides Philippe's suggestion?
> 

Not that I am aware of at this very second.

--js
diff mbox series

Patch

diff --git a/include/hw/ide.h b/include/hw/ide.h
index d52c211f32..c5ce5da4f4 100644
--- a/include/hw/ide.h
+++ b/include/hw/ide.h
@@ -4,8 +4,6 @@ 
 #include "hw/isa/isa.h"
 #include "exec/memory.h"
 
-#define MAX_IDE_DEVS	2
-
 /* ide-isa.c */
 ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq,
                         DriveInfo *hd0, DriveInfo *hd1);
diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h
index 1bc1fc73e5..55da35d768 100644
--- a/include/hw/ide/internal.h
+++ b/include/hw/ide/internal.h
@@ -27,6 +27,8 @@  typedef struct IDEDMAOps IDEDMAOps;
 #define TYPE_IDE_BUS "IDE"
 #define IDE_BUS(obj) OBJECT_CHECK(IDEBus, (obj), TYPE_IDE_BUS)
 
+#define MAX_IDE_DEVS 2
+
 /* Bits of HD_STATUS */
 #define ERR_STAT		0x01
 #define INDEX_STAT		0x02