On 30.04.19 23:45, Ralf Ramsauer wrote:
instead of defining this useful macro in every single config file.

There's only one quirk: ARRAY_SIZE is defined for hypervisor code in util.h,
which we can't include in cell-config.h, as it's GPL-only. So we have to
duplicate the definitions, which might lead to redefinitions of the macro.
Hence, surround the macro by guards.

Also remove the macro from the root cell template.
 > Signed-off-by: Ralf Ramsauer <[email protected]>

Well, I always counted on someone coming up with a better source format for the
configs before someone [else] realizing this obvious cleanup potential. I'm not
so happy with the hoops need for the hypervisor, but it could be worse. Just one
thing when updating this series:

[...]

diff --git a/hypervisor/include/jailhouse/utils.h 
b/hypervisor/include/jailhouse/utils.h
index eae0f390..6f6e8371 100644
--- a/hypervisor/include/jailhouse/utils.h
+++ b/hypervisor/include/jailhouse/utils.h
@@ -12,7 +12,9 @@
   * Partly derived from Linux kernel code.
   */

+#ifndef ARRAY_SIZE
  #define ARRAY_SIZE(array)     (sizeof(array) / sizeof((array)[0]))
+#endif


Please leave a comment why we need the #ifndef here. Because once we remove the
definition from cell-config.h again (that day will come...), we can also revert
this here again.

Jan

--
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to