Skip to contentSkip to conversation

hw/misc/bcm2835_cprman: Make cprman_internals an included source file

PATCH Applied Philippe Mathieu-Daudé 2 participants 3 messages Oct 19, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/misc/bcm2835_cprman: Make cprman_internals an included source file

bcm2835_cprman_internals.h is only include by bcm2835_cprman.c and contains various static array definitions. Make it an included source file (using the .c.inc extension).

---
I'm sending this on top of:
[PATCH v3 00/15] raspi: add the bcm2835 cprman clock manager to avoid a respin before soft freeze.

This patch can be queued or squashed on top of patch #08/15:
"bcm2835_cprman: add a PLL channel skeleton implementation"

Based-on: <[email protected]>

---
 hw/misc/bcm2835_cprman.c                                        | 2 +-
 .../misc/bcm2835_cprman_internals.c.inc                         | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename include/hw/misc/bcm2835_cprman_internals.h => hw/misc/bcm2835_cprman_internals.c.inc (100%)
hw/misc/bcm2835_cprman.c +1 -1
index 7e415a017c9..9d4c0ee6c73 100644
@@ -48,7 +48,7 @@
 #include "migration/vmstate.h"
 #include "hw/qdev-properties.h"
 #include "hw/misc/bcm2835_cprman.h"
-#include "hw/misc/bcm2835_cprman_internals.h"
+#include "bcm2835_cprman_internals.c.inc"
 #include "trace.h"
 
 /* PLL */
hw/misc/bcm2835_cprman_internals.c.inc renamed from include/hw/misc/bcm2835_cprman_internals.h +0 -0
similarity index 100%
rename from include/hw/misc/bcm2835_cprman_internals.h
rename to hw/misc/bcm2835_cprman_internals.c.inc
Signature · 1 line
2.26.2
#1 lore raw
Quoted 26 lines · Philippe Mathieu-Daudé

bcm2835_cprman_internals.h is only include by bcm2835_cprman.c and contains various static array definitions. Make it an included source file (using the .c.inc extension).

---
I'm sending this on top of:
[PATCH v3 00/15] raspi: add the bcm2835 cprman clock manager to avoid a respin before soft freeze.

This patch can be queued or squashed on top of patch #08/15:
"bcm2835_cprman: add a PLL channel skeleton implementation"

Based-on: <[email protected]>

---
 hw/misc/bcm2835_cprman.c                                        | 2 +-
 .../misc/bcm2835_cprman_internals.c.inc                         | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename include/hw/misc/bcm2835_cprman_internals.h => hw/misc/bcm2835_cprman_internals.c.inc (100%)
hw/misc/bcm2835_cprman.c +0 -0
index 7e415a017c9..9d4c0ee6c73 100644

hw/misc/bcm2835_cprman.c line 52

Quoted 6 lines
hw/misc/bcm2835_cprman.c +1 -1
@@ -48,7 +48,7 @@
 #include "migration/vmstate.h"
 #include "hw/qdev-properties.h"
 #include "hw/misc/bcm2835_cprman.h"
-#include "hw/misc/bcm2835_cprman_internals.h"
+#include "bcm2835_cprman_internals.c.inc"
 #include "trace.h"

I guess so, though usually we only use .c.inc files where we actually need to multiply-include them (eg with different #defines to control how they expand). I suppose there's softfloat-specialize.c.inc which only gets included once.

Applied to target-arm.next (not going to try to squash it as it would make applying the following patches in the series a bit awkward).

I am going to move the #include line down so it's not in with all the includes for the .h files.

thanks
-- PMM

#2 lore raw
Quoted 40 lines · Peter Maydell
Quoted 26 lines · Philippe Mathieu-Daudé

bcm2835_cprman_internals.h is only include by bcm2835_cprman.c and contains various static array definitions. Make it an included source file (using the .c.inc extension).

---
I'm sending this on top of:
[PATCH v3 00/15] raspi: add the bcm2835 cprman clock manager to avoid a respin before soft freeze.

This patch can be queued or squashed on top of patch #08/15:
"bcm2835_cprman: add a PLL channel skeleton implementation"

Based-on: <[email protected]>

---
  hw/misc/bcm2835_cprman.c                                        | 2 +-
  .../misc/bcm2835_cprman_internals.c.inc                         | 0
  2 files changed, 1 insertion(+), 1 deletion(-)

rename include/hw/misc/bcm2835_cprman_internals.h => hw/misc/bcm2835_cprman_internals.c.inc (100%)

hw/misc/bcm2835_cprman.c +0 -0
index 7e415a017c9..9d4c0ee6c73 100644

hw/misc/bcm2835_cprman.c line 52

Quoted 6 lines
hw/misc/bcm2835_cprman.c +1 -1
@@ -48,7 +48,7 @@
  #include "migration/vmstate.h"
  #include "hw/qdev-properties.h"
  #include "hw/misc/bcm2835_cprman.h"
-#include "hw/misc/bcm2835_cprman_internals.h"
+#include "bcm2835_cprman_internals.c.inc"
  #include "trace.h"

I guess so, though usually we only use .c.inc files where we actually need to multiply-include them (eg with different #defines to control how they expand). I suppose there's softfloat-specialize.c.inc which only gets included once.

Quoted 3 lines

Applied to target-arm.next (not going to try to squash it as it would make applying the following patches in the series a bit awkward).

Indeed :)

Quoted 3 lines

I am going to move the #include line down so it's not in with all the includes for the .h files.

Ah yes good idea it is cleaner, thanks.

Quoted 4 lines

thanks
-- PMM