diff options
author | Michael Brown <mcb30@ipxe.org> | 2024-01-16 12:23:02 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2024-01-16 13:35:08 +0000 |
commit | 6d29415c89d607b988381bc367c9c521694fa728 (patch) | |
tree | ab4a300dc7856a6fcbeb8b6f4db002e70d2f4e86 /src/drivers | |
parent | 6ca597eee9f95b846a3c2dc1231e63cfc02272c1 (diff) | |
download | ipxe-6d29415c89d607b988381bc367c9c521694fa728.tar.gz |
[libc] Make static_assert() available via assert.hassert
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.c | 4 | ||||
-rw-r--r-- | src/drivers/infiniband/hermon.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/drivers/infiniband/arbel.c b/src/drivers/infiniband/arbel.c index 293c1b647..24c0b53b0 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 c09baf7ae..6fc7d8bd4 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 ) ); |