aboutsummaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2024-01-16 12:23:02 +0000
committerMichael Brown <mcb30@ipxe.org>2024-01-16 13:35:08 +0000
commit6d29415c89d607b988381bc367c9c521694fa728 (patch)
treeab4a300dc7856a6fcbeb8b6f4db002e70d2f4e86 /src/drivers
parent6ca597eee9f95b846a3c2dc1231e63cfc02272c1 (diff)
downloadipxe-6d29415c89d607b988381bc367c9c521694fa728.zip
ipxe-6d29415c89d607b988381bc367c9c521694fa728.tar.gz
ipxe-6d29415c89d607b988381bc367c9c521694fa728.tar.bz2
[libc] Make static_assert() available via assert.h
Expose static_assert() via assert.h and migrate link-time assertions to build-time assertions where possible. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/infiniband/arbel.c4
-rw-r--r--src/drivers/infiniband/hermon.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/drivers/infiniband/arbel.c b/src/drivers/infiniband/arbel.c
index 293c1b6..24c0b53 100644
--- a/src/drivers/infiniband/arbel.c
+++ b/src/drivers/infiniband/arbel.c
@@ -545,8 +545,8 @@ static int arbel_mad ( struct ib_device *ibdev, union ib_mad *mad ) {
union arbelprm_mad mad_ifc;
int rc;
- linker_assert ( sizeof ( *mad ) == sizeof ( mad_ifc.mad ),
- mad_size_mismatch );
+ /* Sanity check */
+ static_assert ( sizeof ( *mad ) == sizeof ( mad_ifc.mad ) );
/* Copy in request packet */
memcpy ( &mad_ifc.mad, mad, sizeof ( mad_ifc.mad ) );
diff --git a/src/drivers/infiniband/hermon.c b/src/drivers/infiniband/hermon.c
index c09baf7..6fc7d8b 100644
--- a/src/drivers/infiniband/hermon.c
+++ b/src/drivers/infiniband/hermon.c
@@ -779,8 +779,8 @@ static int hermon_mad ( struct ib_device *ibdev, union ib_mad *mad ) {
union hermonprm_mad mad_ifc;
int rc;
- linker_assert ( sizeof ( *mad ) == sizeof ( mad_ifc.mad ),
- mad_size_mismatch );
+ /* Sanity check */
+ static_assert ( sizeof ( *mad ) == sizeof ( mad_ifc.mad ) );
/* Copy in request packet */
memcpy ( &mad_ifc.mad, mad, sizeof ( mad_ifc.mad ) );