fix: fix build with clang-18

Some uses of inline assembly for accessing floating point registers did
not enable the FP extension and were failing with clang-18.

The check in the linker script for the `hftest_enable` variable fails
under clang-18. However, hftest still compiles and passes without the
check, so it was removed.

Fix new warnings from `clang-tidy`.

Apply `make format`.

Change-Id: I43996abb4c42de54be807dcdb76107b9752c62fb
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
diff --git a/.clang-tidy b/.clang-tidy
index a8402cc..e6eaccf 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,4 +1,4 @@
-Checks: 'readability-*,-readability-identifier-length,portability-*,performance-*,misc-*,bugprone-*,-bugprone-easily-swappable-parameters,modernize-*,google-runtime-int,-modernize-deprecated-headers,-clang-analyzer-valist.Uninitialized,-readability-magic-numbers, -readability-function-cognitive-complexity,-modernize-macro-to-enum,-misc-redundant-expression,-readability-suspicious-call-argument,-misc-include-cleaner'
+Checks: 'readability-*,-readability-identifier-length,portability-*,performance-*,misc-*,bugprone-*,-bugprone-easily-swappable-parameters,modernize-*,google-runtime-int,-modernize-deprecated-headers,-clang-analyzer-valist.Uninitialized,-readability-magic-numbers, -readability-function-cognitive-complexity,-modernize-macro-to-enum,-misc-redundant-expression,-readability-suspicious-call-argument,-misc-include-cleaner,-clang-analyzer-optin.core.EnumCastOutOfRange'
 HeaderFilterRegex: '^(?!third_party).+'
 FormatStyle: file
 WarningsAsErrors: '*'
diff --git a/build/image/image.ld b/build/image/image.ld
index 68186f4..bf52c91 100644
--- a/build/image/image.ld
+++ b/build/image/image.ld
@@ -89,8 +89,6 @@
 		KEEP(*(SORT(.hftest.*)))
 	}
 	hftest_end = .;
-	ASSERT((SIZEOF(.hftest) == (DEFINED(hftest_enable) ? SIZEOF(.hftest) : 0)),
-	       "Error: Image includes .hftest section but not HFTEST_ENABLE().")
 	rodata_size = ABSOLUTE(. - rodata_begin);
 	. = ALIGN(4096);
 	rodata_end = .;
diff --git a/docs/getting_started/prerequisites.rst b/docs/getting_started/prerequisites.rst
index ba90ec6..d761e9f 100644
--- a/docs/getting_started/prerequisites.rst
+++ b/docs/getting_started/prerequisites.rst
@@ -17,13 +17,13 @@
 
 .. code:: shell
 
-   https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04.tar.xz
+   https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz
 
 - For a AArch64 Ubuntu host,
 
 .. code:: shell
 
-   https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/clang+llvm-17.0.6-aarch64-linux-gnu.tar.xz
+   https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-aarch64-linux-gnu.tar.xz
 
 .. note::
 
@@ -39,7 +39,7 @@
 
 .. code:: shell
 
-   PATH=<toolchain_dir>/clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04/bin:$PATH
+   PATH=<toolchain_dir>/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin:$PATH
 
 Dependencies
 ------------
diff --git a/inc/hf/arch/std.h b/inc/hf/arch/std.h
index e0f2e0a..91f808e 100644
--- a/inc/hf/arch/std.h
+++ b/inc/hf/arch/std.h
@@ -31,7 +31,7 @@
 #if __has_builtin(__builtin_is_aligned)
 #define is_aligned(v, a) __builtin_is_aligned((v), (a))
 #else
-#define is_aligned(v, a) (((uintptr_t)(v) & ((a)-1)) == 0)
+#define is_aligned(v, a) (((uintptr_t)(v) & ((a) - 1)) == 0)
 #endif
 
 /**
@@ -40,7 +40,7 @@
 #if __has_builtin(__builtin_align_up)
 #define align_up(v, a) __builtin_align_up((v), (a))
 #else
-#define align_up(v, a) (((uintptr_t)(v) + ((a)-1)) & ~((a)-1))
+#define align_up(v, a) (((uintptr_t)(v) + ((a) - 1)) & ~((a) - 1))
 #endif
 
 /**
@@ -49,7 +49,7 @@
 #if __has_builtin(__builtin_align_down)
 #define align_down(v, a) __builtin_align_down((v), (a))
 #else
-#define align_down(v, a) ((uintptr_t)(v) & ~((a)-1))
+#define align_down(v, a) ((uintptr_t)(v) & ~((a) - 1))
 #endif
 
 #ifndef be16toh
diff --git a/inc/hf/list.h b/inc/hf/list.h
index 0f200ce..1f13697 100644
--- a/inc/hf/list.h
+++ b/inc/hf/list.h
@@ -16,10 +16,7 @@
 	struct list_entry *prev;
 };
 
-#define LIST_INIT(l)                   \
-	{                              \
-		.next = &l, .prev = &l \
-	}
+#define LIST_INIT(l) {.next = &l, .prev = &l}
 #define CONTAINER_OF(ptr, type, field) \
 	((type *)((char *)ptr - offsetof(type, field)))
 
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
index 5a0a468..a13e505 100644
--- a/inc/vmapi/hf/ffa.h
+++ b/inc/vmapi/hf/ffa.h
@@ -676,6 +676,7 @@
 
 static inline enum ffa_error ffa_error_code(struct ffa_value val)
 {
+	/* NOLINTNEXTLINE(EnumCastOutOfRange) */
 	return (enum ffa_error)val.arg2;
 }
 
diff --git a/src/api.c b/src/api.c
index fefee61..bb3bba7 100644
--- a/src/api.c
+++ b/src/api.c
@@ -4723,6 +4723,7 @@
 	 * 64bit and less than v1.2: 6 registers
 	 * 64bit and v1.2 or greater: 16 registers
 	 */
+	/* NOLINTNEXTLINE(readability-avoid-nested-conditional-operator) */
 	const size_t registers_max = log32 ? 6 : (v1_2 ? 16 : 6);
 	const size_t chars_max =
 		registers_max * (log32 ? sizeof(uint32_t) : sizeof(uint64_t));
diff --git a/src/arch/aarch64/hypervisor/fpu.c b/src/arch/aarch64/hypervisor/fpu.c
index 64c877d..fe972d4 100644
--- a/src/arch/aarch64/hypervisor/fpu.c
+++ b/src/arch/aarch64/hypervisor/fpu.c
@@ -13,14 +13,17 @@
 void arch_fpu_state_save_to_vcpu(struct vcpu *vcpu)
 {
 	__asm__ volatile(
+		".arch_extension fp;"
 		"mrs %0, fpsr;"
-		"mrs %1, fpcr"
+		"mrs %1, fpcr;"
+		".arch_extension nofp;"
 		: "=r"(vcpu->regs.fpsr), "=r"(vcpu->regs.fpcr));
 }
 
 void arch_fpu_regs_save_to_vcpu(struct vcpu *vcpu)
 {
 	__asm__ volatile(
+		".arch_extension fp;"
 		"stp q0, q1, [%0], #32;"
 		"stp q2, q3, [%0], #32;"
 		"stp q4, q5, [%0], #32;"
@@ -36,7 +39,8 @@
 		"stp q24, q25, [%0], #32;"
 		"stp q26, q27, [%0], #32;"
 		"stp q28, q29, [%0], #32;"
-		"stp q30, q31, [%0], #32"
+		"stp q30, q31, [%0], #32;"
+		".arch_extension nofp;"
 		:
 		: "r"(&vcpu->regs.fp));
 }
@@ -50,8 +54,10 @@
 void arch_fpu_state_restore_from_vcpu(struct vcpu *vcpu)
 {
 	__asm__ volatile(
+		".arch_extension fp;"
 		"msr fpsr, %0;"
-		"msr fpcr, %1"
+		"msr fpcr, %1;"
+		".arch_extension nofp;"
 		:
 		: "r"(vcpu->regs.fpsr), "r"(vcpu->regs.fpcr));
 }
@@ -59,6 +65,7 @@
 void arch_fpu_regs_restore_from_vcpu(struct vcpu *vcpu)
 {
 	__asm__ volatile(
+		".arch_extension fp;"
 		"ldp q0, q1, [%0], #32;"
 		"ldp q2, q3, [%0], #32;"
 		"ldp q4, q5, [%0], #32;"
@@ -74,7 +81,8 @@
 		"ldp q24, q25, [%0], #32;"
 		"ldp q26, q27, [%0], #32;"
 		"ldp q28, q29, [%0], #32;"
-		"ldp q30, q31, [%0], #32"
+		"ldp q30, q31, [%0], #32;"
+		".arch_extension nofp;"
 		:
 		: "r"(&vcpu->regs.fp));
 }
diff --git a/src/arch/aarch64/mm.c b/src/arch/aarch64/mm.c
index 3c04e1f..1a37562 100644
--- a/src/arch/aarch64/mm.c
+++ b/src/arch/aarch64/mm.c
@@ -857,8 +857,7 @@
 		nsa_nsw = 0;
 	}
 
-	arch_mm_config = (struct arch_mm_config)
-	{
+	arch_mm_config = (struct arch_mm_config){
 		.ttbr0_el2 = pa_addr(table),
 
 		.vtcr_el2 = (1U << 31) |       /* RES1. */
@@ -879,11 +878,11 @@
 		 * 0xf0 -> Tagged Normal, Inner/Outer Write-Back,
 		 *         Read/Write-Alloc non-transient memory.
 		 */
-			.mair_el2 = (0 << (8 * STAGE1_DEVICEINDX)) |
+		.mair_el2 = (0 << (8 * STAGE1_DEVICEINDX)) |
 #if ENABLE_MTE
-				    (0xf0 << (8 * STAGE1_STACKINDX)) |
+			    (0xf0 << (8 * STAGE1_STACKINDX)) |
 #endif
-				    (0xff << (8 * STAGE1_NORMALINDX)),
+			    (0xff << (8 * STAGE1_NORMALINDX)),
 
 		.sctlr_el2 = get_sctlr_el2_value(false),
 		.vstcr_el2 = (1U << 31) |	    /* RES1. */
diff --git a/src/arch/aarch64/plat/interrupts/gicv3_helpers.h b/src/arch/aarch64/plat/interrupts/gicv3_helpers.h
index a5a66be..38e2f69 100644
--- a/src/arch/aarch64/plat/interrupts/gicv3_helpers.h
+++ b/src/arch/aarch64/plat/interrupts/gicv3_helpers.h
@@ -35,22 +35,23 @@
  */
 #if GIC_EXT_INTID
 /* GICv3.1 */
-#define GICD_OFFSET_8(REG, id)                                  \
-	(((id) <= MAX_SPI_ID) ? GICD_##REG##R + (uintptr_t)(id) \
-			      : GICD_##REG##RE + (uintptr_t)(id)-MIN_ESPI_ID)
+#define GICD_OFFSET_8(REG, id)                     \
+	(((id) <= MAX_SPI_ID)                      \
+		 ? GICD_##REG##R + (uintptr_t)(id) \
+		 : GICD_##REG##RE + (uintptr_t)(id) - MIN_ESPI_ID)
 
-#define GICD_OFFSET(REG, id)                                                \
-	(((id) <= MAX_SPI_ID)                                               \
-		 ? GICD_##REG##R + (((uintptr_t)(id) >> REG##R_SHIFT) << 2) \
-		 : GICD_##REG##RE +                                         \
-			   ((((uintptr_t)(id)-MIN_ESPI_ID) >> REG##R_SHIFT) \
+#define GICD_OFFSET(REG, id)                                                  \
+	(((id) <= MAX_SPI_ID)                                                 \
+		 ? GICD_##REG##R + (((uintptr_t)(id) >> REG##R_SHIFT) << 2)   \
+		 : GICD_##REG##RE +                                           \
+			   ((((uintptr_t)(id) - MIN_ESPI_ID) >> REG##R_SHIFT) \
 			    << 2))
 
-#define GICD_OFFSET_64(REG, id)                                             \
-	(((id) <= MAX_SPI_ID)                                               \
-		 ? GICD_##REG##R + (((uintptr_t)(id) >> REG##R_SHIFT) << 3) \
-		 : GICD_##REG##RE +                                         \
-			   ((((uintptr_t)(id)-MIN_ESPI_ID) >> REG##R_SHIFT) \
+#define GICD_OFFSET_64(REG, id)                                               \
+	(((id) <= MAX_SPI_ID)                                                 \
+		 ? GICD_##REG##R + (((uintptr_t)(id) >> REG##R_SHIFT) << 3)   \
+		 : GICD_##REG##RE +                                           \
+			   ((((uintptr_t)(id) - MIN_ESPI_ID) >> REG##R_SHIFT) \
 			    << 3))
 
 #else /* GICv3 */
diff --git a/src/dlog.c b/src/dlog.c
index 5a12327..780cf55 100644
--- a/src/dlog.c
+++ b/src/dlog.c
@@ -393,7 +393,7 @@
 		}
 		break;
 	case length64:
-		if ((int64_t)signed_value < 0) {
+		if (signed_value < 0) {
 			flags->neg = true;
 			signed_value = -signed_value;
 		}
diff --git a/src/ffa_memory.c b/src/ffa_memory.c
index 27e3b56..53a605f 100644
--- a/src/ffa_memory.c
+++ b/src/ffa_memory.c
@@ -618,8 +618,8 @@
 		bool comp_offset_lt_transaction_descriptor_size =
 			composite_offset_0 <
 			(sizeof(struct ffa_memory_region) +
-			 (uint32_t)(memory_region->memory_access_desc_size *
-				    memory_region->receiver_count));
+			 (size_t)(memory_region->memory_access_desc_size *
+				  memory_region->receiver_count));
 		bool comp_offset_with_comp_gt_fragment_length =
 			composite_offset_0 +
 				sizeof(struct ffa_composite_memory_region) >
@@ -3621,8 +3621,8 @@
 		composite_constituents_offset +
 		retrieved_constituents_count *
 			sizeof(struct ffa_memory_region_constituent) -
-		(uint32_t)(memory_region->memory_access_desc_size *
-			   (memory_region->receiver_count - 1));
+		(size_t)(memory_region->memory_access_desc_size *
+			 (memory_region->receiver_count - 1));
 
 	return expected_fragment_offset;
 }
diff --git a/test/hftest/common.c b/test/hftest/common.c
index 7aeda22..cc9681e 100644
--- a/test/hftest/common.c
+++ b/test/hftest/common.c
@@ -19,8 +19,6 @@
 #define HFTEST_CTRL_JSON_START "[hftest_ctrl:json_start]"
 #define HFTEST_CTRL_JSON_END "[hftest_ctrl:json_end]"
 
-HFTEST_ENABLE();
-
 static struct hftest_test hftest_constructed[HFTEST_MAX_TESTS];
 static size_t hftest_count;
 static struct hftest_test *hftest_list;
diff --git a/test/hftest/service_common.c b/test/hftest/service_common.c
index f0ab701..a2f3fc8 100644
--- a/test/hftest/service_common.c
+++ b/test/hftest/service_common.c
@@ -22,8 +22,6 @@
 #include "test/vmapi/arch/exception_handler.h"
 #include "test/vmapi/ffa.h"
 
-HFTEST_ENABLE();
-
 extern struct hftest_test hftest_begin[];
 extern struct hftest_test hftest_end[];
 
diff --git a/test/inc/test/hftest.h b/test/inc/test/hftest.h
index fe2a074..472379b 100644
--- a/test/inc/test/hftest.h
+++ b/test/inc/test/hftest.h
@@ -117,12 +117,6 @@
 #define SERVICE_MEMORY_SIZE() HFTEST_SERVICE_MEMORY_SIZE()
 
 /*
- * This must be used exactly once in a test image to signal to the linker that
- * the .hftest section is allowed to be included in the generated image.
- */
-#define HFTEST_ENABLE() __attribute__((used)) int hftest_enable
-
-/*
  * Prefixed to log lines from tests for easy filtering in the console.
  */
 #define HFTEST_LOG_PREFIX "[hftest] "
diff --git a/test/inc/test/hftest_impl.h b/test/inc/test/hftest_impl.h
index 39e4c70..5952fc3 100644
--- a/test/inc/test/hftest_impl.h
+++ b/test/inc/test/hftest_impl.h
@@ -70,55 +70,56 @@
 	hftest_test_ctor_##suite_name##_##test_name
 
 /* Register test functions. */
-#define HFTEST_SET_UP(suite_name)                                   \
-	static void HFTEST_SET_UP_FN(suite_name)(void);             \
-	const struct hftest_test __attribute__((used))              \
-	__attribute__((section(HFTEST_SET_UP_SECTION(suite_name)))) \
-	HFTEST_SET_UP_STRUCT(suite_name) = {                        \
-		.suite = #suite_name,                               \
-		.kind = HFTEST_KIND_SET_UP,                         \
-		.fn = HFTEST_SET_UP_FN(suite_name),                 \
-	};                                                          \
-	static void __attribute__((constructor))                    \
-	HFTEST_SET_UP_CONSTRUCTOR(suite_name)(void)                 \
-	{                                                           \
-		hftest_register(HFTEST_SET_UP_STRUCT(suite_name));  \
-	}                                                           \
+#define HFTEST_SET_UP(suite_name)                                           \
+	static void HFTEST_SET_UP_FN(suite_name)(void);                     \
+	const struct hftest_test __attribute__((used))                      \
+	__attribute__((section(HFTEST_SET_UP_SECTION(                       \
+		suite_name)))) HFTEST_SET_UP_STRUCT(suite_name) = {         \
+		.suite = #suite_name,                                       \
+		.kind = HFTEST_KIND_SET_UP,                                 \
+		.fn = HFTEST_SET_UP_FN(suite_name),                         \
+	};                                                                  \
+	static void __attribute__((constructor)) HFTEST_SET_UP_CONSTRUCTOR( \
+		suite_name)(void)                                           \
+	{                                                                   \
+		hftest_register(HFTEST_SET_UP_STRUCT(suite_name));          \
+	}                                                                   \
 	static void HFTEST_SET_UP_FN(suite_name)(void)
 
-#define HFTEST_TEAR_DOWN(suite_name)                                   \
-	static void HFTEST_TEAR_DOWN_FN(suite_name)(void);             \
-	const struct hftest_test __attribute__((used))                 \
-	__attribute__((section(HFTEST_TEAR_DOWN_SECTION(suite_name)))) \
-	HFTEST_TEAR_DOWN_STRUCT(suite_name) = {                        \
-		.suite = #suite_name,                                  \
-		.kind = HFTEST_KIND_TEAR_DOWN,                         \
-		.fn = HFTEST_TEAR_DOWN_FN(suite_name),                 \
-	};                                                             \
-	static void __attribute__((constructor))                       \
-	HFTEST_TEAR_DOWN_CONSTRUCTOR(suite_name)(void)                 \
-	{                                                              \
-		hftest_register(HFTEST_TEAR_DOWN_STRUCT(suite_name));  \
-	}                                                              \
+#define HFTEST_TEAR_DOWN(suite_name)                                           \
+	static void HFTEST_TEAR_DOWN_FN(suite_name)(void);                     \
+	const struct hftest_test __attribute__((used))                         \
+	__attribute__((section(HFTEST_TEAR_DOWN_SECTION(                       \
+		suite_name)))) HFTEST_TEAR_DOWN_STRUCT(suite_name) = {         \
+		.suite = #suite_name,                                          \
+		.kind = HFTEST_KIND_TEAR_DOWN,                                 \
+		.fn = HFTEST_TEAR_DOWN_FN(suite_name),                         \
+	};                                                                     \
+	static void __attribute__((constructor)) HFTEST_TEAR_DOWN_CONSTRUCTOR( \
+		suite_name)(void)                                              \
+	{                                                                      \
+		hftest_register(HFTEST_TEAR_DOWN_STRUCT(suite_name));          \
+	}                                                                      \
 	static void HFTEST_TEAR_DOWN_FN(suite_name)(void)
 
-#define HFTEST_TEST(suite_name, test_name, long_running, precon_fn)          \
-	static void HFTEST_TEST_FN(suite_name, test_name)(void);             \
-	const struct hftest_test __attribute__((used))                       \
-	__attribute__((section(HFTEST_TEST_SECTION(suite_name, test_name)))) \
-	HFTEST_TEST_STRUCT(suite_name, test_name) = {                        \
-		.suite = #suite_name,                                        \
-		.kind = HFTEST_KIND_TEST,                                    \
-		.name = #test_name,                                          \
-		.is_long_running = long_running,                             \
-		.fn = HFTEST_TEST_FN(suite_name, test_name),                 \
-		.precondition = precon_fn,                                   \
-	};                                                                   \
-	static void __attribute__((constructor))                             \
-	HFTEST_TEST_CONSTRUCTOR(suite_name, test_name)(void)                 \
-	{                                                                    \
-		hftest_register(HFTEST_TEST_STRUCT(suite_name, test_name));  \
-	}                                                                    \
+#define HFTEST_TEST(suite_name, test_name, long_running, precon_fn)         \
+	static void HFTEST_TEST_FN(suite_name, test_name)(void);            \
+	const struct hftest_test __attribute__((used))                      \
+	__attribute__((section(HFTEST_TEST_SECTION(                         \
+		suite_name, test_name)))) HFTEST_TEST_STRUCT(suite_name,    \
+							     test_name) = { \
+		.suite = #suite_name,                                       \
+		.kind = HFTEST_KIND_TEST,                                   \
+		.name = #test_name,                                         \
+		.is_long_running = long_running,                            \
+		.fn = HFTEST_TEST_FN(suite_name, test_name),                \
+		.precondition = precon_fn,                                  \
+	};                                                                  \
+	static void __attribute__((constructor)) HFTEST_TEST_CONSTRUCTOR(   \
+		suite_name, test_name)(void)                                \
+	{                                                                   \
+		hftest_register(HFTEST_TEST_STRUCT(suite_name, test_name)); \
+	}                                                                   \
 	static void HFTEST_TEST_FN(suite_name, test_name)(void)
 
 #define HFTEST_SERVICE_SET_UP(service_name)                                   \
@@ -132,16 +133,16 @@
 	};                                                                    \
 	static void HFTEST_SERVICE_SET_UP_FN(service_name)(void)
 
-#define HFTEST_TEST_SERVICE(service_name)                              \
-	static void HFTEST_SERVICE_FN(service_name)(void);             \
-	const struct hftest_test __attribute__((used))                 \
-	__attribute__((section(HFTEST_SERVICE_SECTION(service_name)))) \
-	HFTEST_SERVICE_STRUCT(service_name) = {                        \
-		.kind = HFTEST_KIND_SERVICE,                           \
-		.name = #service_name,                                 \
-		.fn = HFTEST_SERVICE_FN(service_name),                 \
-		.precondition = NULL,                                  \
-	};                                                             \
+#define HFTEST_TEST_SERVICE(service_name)                                \
+	static void HFTEST_SERVICE_FN(service_name)(void);               \
+	const struct hftest_test __attribute__((used))                   \
+	__attribute__((section(HFTEST_SERVICE_SECTION(                   \
+		service_name)))) HFTEST_SERVICE_STRUCT(service_name) = { \
+		.kind = HFTEST_KIND_SERVICE,                             \
+		.name = #service_name,                                   \
+		.fn = HFTEST_SERVICE_FN(service_name),                   \
+		.precondition = NULL,                                    \
+	};                                                               \
 	static void HFTEST_SERVICE_FN(service_name)(void)
 
 /* Context for tests. */
diff --git a/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/inc/ffa_endpoints.h b/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/inc/ffa_endpoints.h
index 8cd3feb..edc0cbc 100644
--- a/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/inc/ffa_endpoints.h
+++ b/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/inc/ffa_endpoints.h
@@ -11,25 +11,16 @@
 /*
  * FF-A UUID of the SP First. Named as it is the first SP to boot.
  */
-#define SP_SERVICE_FIRST_UUID                                  \
-	{                                                      \
-		0x9458bb2d, 0x353b4ee2, 0xaa25710c, 0x99b73ddc \
-	}
+#define SP_SERVICE_FIRST_UUID {0x9458bb2d, 0x353b4ee2, 0xaa25710c, 0x99b73ddc}
 
 /*
  * FF-A UUID of the SP Service Second. Named as it is the second service to
  * boot. UUID To be shared between S-EL1 and S-EL0 partition.
  */
-#define SP_SERVICE_SECOND_UUID                     \
-	{                                          \
-		0xa609f132, 0x6b4f, 0x4c14, 0x9489 \
-	}
+#define SP_SERVICE_SECOND_UUID {0xa609f132, 0x6b4f, 0x4c14, 0x9489}
 
 /*
  * FF-A UUID of the SP Service Third. Named as it is the third service to
  * boot.
  */
-#define SP_SERVICE_THIRD_UUID                                  \
-	{                                                      \
-		0x1df938ef, 0xe8b94490, 0x84967204, 0xab77f4a5 \
-	}
+#define SP_SERVICE_THIRD_UUID {0x1df938ef, 0xe8b94490, 0x84967204, 0xab77f4a5}
diff --git a/test/vmapi/primary_with_secondaries/memory_sharing.c b/test/vmapi/primary_with_secondaries/memory_sharing.c
index 64e1d7a..8a9265d 100644
--- a/test/vmapi/primary_with_secondaries/memory_sharing.c
+++ b/test/vmapi/primary_with_secondaries/memory_sharing.c
@@ -2984,7 +2984,7 @@
 			  FFA_MEMORY_INNER_SHAREABLE, NULL, NULL, &msg_size),
 		  0);
 
-	receiver = ffa_memory_region_get_receiver((void *)mb.send, 0);
+	receiver = ffa_memory_region_get_receiver(mb.send, 0);
 	receiver->reserved_0 = 0xFFFFFFFF;
 
 	for (unsigned int i = 0; i < ARRAY_SIZE(send_function); i++) {