[app][hwcrypto] Improve C standards compliance
__offsetof => offsetof and include stddef.h
Include lk/compiler.h for countof.
Bug: 110158907
Change-Id: I16af82024ae7ac8e3f575c8db28988c5222ea536
diff --git a/app/hwcrypto/caam.c b/app/hwcrypto/caam.c
index eb11560..3b1920e 100644
--- a/app/hwcrypto/caam.c
+++ b/app/hwcrypto/caam.c
@@ -27,10 +27,12 @@
*/
#include <assert.h>
+#include <lk/compiler.h>
#include <lk/reg.h>
#include <malloc.h>
#include <openssl/digest.h>
#include <openssl/hkdf.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -101,9 +103,9 @@
abort();
}
- writel((uint32_t)pmem.paddr + __offsetof(struct caam_job_rings, in),
+ writel((uint32_t)pmem.paddr + offsetof(struct caam_job_rings, in),
CAAM_IRBAR0); // input ring address
- writel((uint32_t)pmem.paddr + __offsetof(struct caam_job_rings, out),
+ writel((uint32_t)pmem.paddr + offsetof(struct caam_job_rings, out),
CAAM_ORBAR0); // output ring address
/* Initialize job ring sizes */