On 13.06.19 18:20, Jan Kiszka wrote:
On 12.06.19 15:03, Ralf Ramsauer wrote:
Especially when timing is involved, multiplications tend to overflow
32 bit. It's better to use 64 bit variables during the calculation. ULL
for constants ensures the correct width of intermediate results.

Signed-off-by: Ralf Ramsauer <[email protected]>
---
  inmates/lib/include/inmate_common.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/inmates/lib/include/inmate_common.h b/inmates/lib/include/inmate_common.h
index d9f1df5f..c85f1383 100644
--- a/inmates/lib/include/inmate_common.h
+++ b/inmates/lib/include/inmate_common.h
@@ -42,9 +42,9 @@
  #define NULL            ((void *)0)
-#define NS_PER_USEC        1000UL
-#define NS_PER_MSEC        1000000UL
-#define NS_PER_SEC        1000000000UL
+#define NS_PER_USEC        1000ULL
+#define NS_PER_MSEC        1000000ULL
+#define NS_PER_SEC        1000000000ULL
  #ifndef __ASSEMBLY__
  typedef s8 __s8;


Did you check if this is side-effect free for ARMv7 inmates?


OK, can answer this myself: The defines are generic, but they are used on x86 only so far.

Merged the series into next.

Thanks,
Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

--
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/9cda6f51-7293-4d7e-28ed-58c8195357f6%40siemens.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to