diff mbox series

[12/16] hw/devices: Move LAN9118 declarations into a new header

Message ID 20190104175847.6290-13-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series hw: Remove "hw/devices.h" | expand

Commit Message

Philippe Mathieu-Daudé Jan. 4, 2019, 5:58 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/arm/kzm.c             |  2 +-
 hw/arm/mps2.c            |  2 +-
 hw/arm/realview.c        |  1 +
 hw/arm/vexpress.c        |  2 +-
 hw/net/lan9118.c         |  2 +-
 include/hw/devices.h     |  3 ---
 include/hw/net/lan9118.h | 21 +++++++++++++++++++++
 7 files changed, 26 insertions(+), 7 deletions(-)
 create mode 100644 include/hw/net/lan9118.h

Comments

Thomas Huth Jan. 7, 2019, 7:29 a.m. UTC | #1
On 2019-01-04 18:58, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/arm/kzm.c             |  2 +-
>  hw/arm/mps2.c            |  2 +-
>  hw/arm/realview.c        |  1 +
>  hw/arm/vexpress.c        |  2 +-
>  hw/net/lan9118.c         |  2 +-
>  include/hw/devices.h     |  3 ---
>  include/hw/net/lan9118.h | 21 +++++++++++++++++++++
>  7 files changed, 26 insertions(+), 7 deletions(-)
>  create mode 100644 include/hw/net/lan9118.h
> 
> diff --git a/hw/arm/kzm.c b/hw/arm/kzm.c
> index 864c7bd411..139934c4ec 100644
> --- a/hw/arm/kzm.c
> +++ b/hw/arm/kzm.c
> @@ -22,7 +22,7 @@
>  #include "qemu/error-report.h"
>  #include "exec/address-spaces.h"
>  #include "net/net.h"
> -#include "hw/devices.h"
> +#include "hw/net/lan9118.h"
>  #include "hw/char/serial.h"
>  #include "sysemu/qtest.h"
>  
> diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
> index e3d698ba6c..54b7395849 100644
> --- a/hw/arm/mps2.c
> +++ b/hw/arm/mps2.c
> @@ -36,7 +36,7 @@
>  #include "hw/timer/cmsdk-apb-timer.h"
>  #include "hw/timer/cmsdk-apb-dualtimer.h"
>  #include "hw/misc/mps2-scc.h"
> -#include "hw/devices.h"
> +#include "hw/net/lan9118.h"
>  #include "net/net.h"
>  
>  typedef enum MPS2FPGAType {
> diff --git a/hw/arm/realview.c b/hw/arm/realview.c
> index 242f5a87b6..e9983c8763 100644
> --- a/hw/arm/realview.c
> +++ b/hw/arm/realview.c
> @@ -15,6 +15,7 @@
>  #include "hw/arm/arm.h"
>  #include "hw/arm/primecell.h"
>  #include "hw/devices.h"
> +#include "hw/net/lan9118.h"
>  #include "hw/pci/pci.h"
>  #include "net/net.h"
>  #include "sysemu/sysemu.h"
> diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
> index c02d18ee61..12e2c3986f 100644
> --- a/hw/arm/vexpress.c
> +++ b/hw/arm/vexpress.c
> @@ -28,7 +28,7 @@
>  #include "hw/sysbus.h"
>  #include "hw/arm/arm.h"
>  #include "hw/arm/primecell.h"
> -#include "hw/devices.h"
> +#include "hw/net/lan9118.h"
>  #include "hw/i2c/i2c.h"
>  #include "net/net.h"
>  #include "sysemu/sysemu.h"
> diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c
> index a6269d9463..a428b16eda 100644
> --- a/hw/net/lan9118.c
> +++ b/hw/net/lan9118.c
> @@ -14,7 +14,7 @@
>  #include "hw/sysbus.h"
>  #include "net/net.h"
>  #include "net/eth.h"
> -#include "hw/devices.h"
> +#include "hw/net/lan9118.h"
>  #include "sysemu/sysemu.h"
>  #include "hw/ptimer.h"
>  #include "qemu/log.h"
> diff --git a/include/hw/devices.h b/include/hw/devices.h
> index ba9034050b..ebc45c8799 100644
> --- a/include/hw/devices.h
> +++ b/include/hw/devices.h
> @@ -8,7 +8,4 @@
>  /* smc91c111.c */
>  void smc91c111_init(NICInfo *, uint32_t, qemu_irq);
>  
> -/* lan9118.c */
> -void lan9118_init(NICInfo *, uint32_t, qemu_irq);
> -
>  #endif
> diff --git a/include/hw/net/lan9118.h b/include/hw/net/lan9118.h
> new file mode 100644
> index 0000000000..340d6681b7
> --- /dev/null
> +++ b/include/hw/net/lan9118.h
> @@ -0,0 +1,21 @@
> +/*
> + * SMSC LAN9118 Ethernet interface emulation
> + *
> + * Copyright (c) 2009 CodeSourcery, LLC.
> + * Written by Paul Brook
> + *
> + * This code is licensed under the GNU GPL v2
> + *
> + * Contributions after 2012-01-13 are licensed under the terms of the
> + * GNU GPL, version 2 or (at your option) any later version.

Since your contribution here is after 2012 and the file content is also
just a trivial one-line prototype, please change the license code to say
GPLv2+ only right from the start. We should avoid these v2 + v2+
statements in new files.

> + */
> +
> +#ifndef HW_NET_LAN9118_H
> +#define HW_NET_LAN9118_H
> +
> +#include "hw/irq.h"
> +#include "net/net.h"
> +
> +void lan9118_init(NICInfo *, uint32_t, qemu_irq);
> +
> +#endif
> 

 Thomas
Philippe Mathieu-Daudé Jan. 7, 2019, 8:04 a.m. UTC | #2
On 1/7/19 8:29 AM, Thomas Huth wrote:
> On 2019-01-04 18:58, Philippe Mathieu-Daudé wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>  hw/arm/kzm.c             |  2 +-
>>  hw/arm/mps2.c            |  2 +-
>>  hw/arm/realview.c        |  1 +
>>  hw/arm/vexpress.c        |  2 +-
>>  hw/net/lan9118.c         |  2 +-
>>  include/hw/devices.h     |  3 ---
>>  include/hw/net/lan9118.h | 21 +++++++++++++++++++++
>>  7 files changed, 26 insertions(+), 7 deletions(-)
>>  create mode 100644 include/hw/net/lan9118.h
>>
>> diff --git a/hw/arm/kzm.c b/hw/arm/kzm.c
>> index 864c7bd411..139934c4ec 100644
>> --- a/hw/arm/kzm.c
>> +++ b/hw/arm/kzm.c
>> @@ -22,7 +22,7 @@
>>  #include "qemu/error-report.h"
>>  #include "exec/address-spaces.h"
>>  #include "net/net.h"
>> -#include "hw/devices.h"
>> +#include "hw/net/lan9118.h"
>>  #include "hw/char/serial.h"
>>  #include "sysemu/qtest.h"
>>  
>> diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
>> index e3d698ba6c..54b7395849 100644
>> --- a/hw/arm/mps2.c
>> +++ b/hw/arm/mps2.c
>> @@ -36,7 +36,7 @@
>>  #include "hw/timer/cmsdk-apb-timer.h"
>>  #include "hw/timer/cmsdk-apb-dualtimer.h"
>>  #include "hw/misc/mps2-scc.h"
>> -#include "hw/devices.h"
>> +#include "hw/net/lan9118.h"
>>  #include "net/net.h"
>>  
>>  typedef enum MPS2FPGAType {
>> diff --git a/hw/arm/realview.c b/hw/arm/realview.c
>> index 242f5a87b6..e9983c8763 100644
>> --- a/hw/arm/realview.c
>> +++ b/hw/arm/realview.c
>> @@ -15,6 +15,7 @@
>>  #include "hw/arm/arm.h"
>>  #include "hw/arm/primecell.h"
>>  #include "hw/devices.h"
>> +#include "hw/net/lan9118.h"
>>  #include "hw/pci/pci.h"
>>  #include "net/net.h"
>>  #include "sysemu/sysemu.h"
>> diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
>> index c02d18ee61..12e2c3986f 100644
>> --- a/hw/arm/vexpress.c
>> +++ b/hw/arm/vexpress.c
>> @@ -28,7 +28,7 @@
>>  #include "hw/sysbus.h"
>>  #include "hw/arm/arm.h"
>>  #include "hw/arm/primecell.h"
>> -#include "hw/devices.h"
>> +#include "hw/net/lan9118.h"
>>  #include "hw/i2c/i2c.h"
>>  #include "net/net.h"
>>  #include "sysemu/sysemu.h"
>> diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c
>> index a6269d9463..a428b16eda 100644
>> --- a/hw/net/lan9118.c
>> +++ b/hw/net/lan9118.c
>> @@ -14,7 +14,7 @@
>>  #include "hw/sysbus.h"
>>  #include "net/net.h"
>>  #include "net/eth.h"
>> -#include "hw/devices.h"
>> +#include "hw/net/lan9118.h"
>>  #include "sysemu/sysemu.h"
>>  #include "hw/ptimer.h"
>>  #include "qemu/log.h"
>> diff --git a/include/hw/devices.h b/include/hw/devices.h
>> index ba9034050b..ebc45c8799 100644
>> --- a/include/hw/devices.h
>> +++ b/include/hw/devices.h
>> @@ -8,7 +8,4 @@
>>  /* smc91c111.c */
>>  void smc91c111_init(NICInfo *, uint32_t, qemu_irq);
>>  
>> -/* lan9118.c */
>> -void lan9118_init(NICInfo *, uint32_t, qemu_irq);
>> -
>>  #endif
>> diff --git a/include/hw/net/lan9118.h b/include/hw/net/lan9118.h
>> new file mode 100644
>> index 0000000000..340d6681b7
>> --- /dev/null
>> +++ b/include/hw/net/lan9118.h
>> @@ -0,0 +1,21 @@
>> +/*
>> + * SMSC LAN9118 Ethernet interface emulation
>> + *
>> + * Copyright (c) 2009 CodeSourcery, LLC.
>> + * Written by Paul Brook
>> + *
>> + * This code is licensed under the GNU GPL v2
>> + *
>> + * Contributions after 2012-01-13 are licensed under the terms of the
>> + * GNU GPL, version 2 or (at your option) any later version.
> 
> Since your contribution here is after 2012 and the file content is also
> just a trivial one-line prototype, please change the license code to say
> GPLv2+ only right from the start. We should avoid these v2 + v2+
> statements in new files.

OK.

> 
>> + */
>> +
>> +#ifndef HW_NET_LAN9118_H
>> +#define HW_NET_LAN9118_H
>> +
>> +#include "hw/irq.h"
>> +#include "net/net.h"
>> +
>> +void lan9118_init(NICInfo *, uint32_t, qemu_irq);
>> +
>> +#endif
>>
> 
>  Thomas
>
diff mbox series

Patch

diff --git a/hw/arm/kzm.c b/hw/arm/kzm.c
index 864c7bd411..139934c4ec 100644
--- a/hw/arm/kzm.c
+++ b/hw/arm/kzm.c
@@ -22,7 +22,7 @@ 
 #include "qemu/error-report.h"
 #include "exec/address-spaces.h"
 #include "net/net.h"
-#include "hw/devices.h"
+#include "hw/net/lan9118.h"
 #include "hw/char/serial.h"
 #include "sysemu/qtest.h"
 
diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
index e3d698ba6c..54b7395849 100644
--- a/hw/arm/mps2.c
+++ b/hw/arm/mps2.c
@@ -36,7 +36,7 @@ 
 #include "hw/timer/cmsdk-apb-timer.h"
 #include "hw/timer/cmsdk-apb-dualtimer.h"
 #include "hw/misc/mps2-scc.h"
-#include "hw/devices.h"
+#include "hw/net/lan9118.h"
 #include "net/net.h"
 
 typedef enum MPS2FPGAType {
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index 242f5a87b6..e9983c8763 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -15,6 +15,7 @@ 
 #include "hw/arm/arm.h"
 #include "hw/arm/primecell.h"
 #include "hw/devices.h"
+#include "hw/net/lan9118.h"
 #include "hw/pci/pci.h"
 #include "net/net.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index c02d18ee61..12e2c3986f 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -28,7 +28,7 @@ 
 #include "hw/sysbus.h"
 #include "hw/arm/arm.h"
 #include "hw/arm/primecell.h"
-#include "hw/devices.h"
+#include "hw/net/lan9118.h"
 #include "hw/i2c/i2c.h"
 #include "net/net.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c
index a6269d9463..a428b16eda 100644
--- a/hw/net/lan9118.c
+++ b/hw/net/lan9118.c
@@ -14,7 +14,7 @@ 
 #include "hw/sysbus.h"
 #include "net/net.h"
 #include "net/eth.h"
-#include "hw/devices.h"
+#include "hw/net/lan9118.h"
 #include "sysemu/sysemu.h"
 #include "hw/ptimer.h"
 #include "qemu/log.h"
diff --git a/include/hw/devices.h b/include/hw/devices.h
index ba9034050b..ebc45c8799 100644
--- a/include/hw/devices.h
+++ b/include/hw/devices.h
@@ -8,7 +8,4 @@ 
 /* smc91c111.c */
 void smc91c111_init(NICInfo *, uint32_t, qemu_irq);
 
-/* lan9118.c */
-void lan9118_init(NICInfo *, uint32_t, qemu_irq);
-
 #endif
diff --git a/include/hw/net/lan9118.h b/include/hw/net/lan9118.h
new file mode 100644
index 0000000000..340d6681b7
--- /dev/null
+++ b/include/hw/net/lan9118.h
@@ -0,0 +1,21 @@ 
+/*
+ * SMSC LAN9118 Ethernet interface emulation
+ *
+ * Copyright (c) 2009 CodeSourcery, LLC.
+ * Written by Paul Brook
+ *
+ * This code is licensed under the GNU GPL v2
+ *
+ * Contributions after 2012-01-13 are licensed under the terms of the
+ * GNU GPL, version 2 or (at your option) any later version.
+ */
+
+#ifndef HW_NET_LAN9118_H
+#define HW_NET_LAN9118_H
+
+#include "hw/irq.h"
+#include "net/net.h"
+
+void lan9118_init(NICInfo *, uint32_t, qemu_irq);
+
+#endif