From e4308ac7832e365ed15ac19629455d7ea1cf8131 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sat, 15 Jun 2024 12:54:44 +0200 Subject: [PATCH 1/3] macro-fundamental: correct comment and remove trailing ';' for macro Follow-up for 3c2f2146f50c75662987541719bedc4aee9df939 --- src/fundamental/macro-fundamental.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fundamental/macro-fundamental.h b/src/fundamental/macro-fundamental.h index 8aca5f784a..bbfdcdb218 100644 --- a/src/fundamental/macro-fundamental.h +++ b/src/fundamental/macro-fundamental.h @@ -517,9 +517,9 @@ static inline uint64_t ALIGN_OFFSET_U64(uint64_t l, uint64_t ali) { } \ } -/* Restriction/bug (see above) was fixed in GCC 15 and clang 19.*/ +/* Restriction/bug (see below) was fixed in GCC 15 and clang 19. */ #if __GNUC__ >= 15 || (defined(__clang__) && __clang_major__ >= 19) -#define DECLARE_FLEX_ARRAY(type, name) type name[]; +#define DECLARE_FLEX_ARRAY(type, name) type name[] #else /* Declare a flexible array usable in a union. * This is essentially a work-around for a pointless constraint in C99 From c89d1e425af8b772b1629b2f8551e60315ca4f01 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sat, 15 Jun 2024 12:55:21 +0200 Subject: [PATCH 2/3] missing_loop: add missing assertions for fallback values --- src/basic/missing_loop.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/basic/missing_loop.h b/src/basic/missing_loop.h index f83a14c914..56e46f0b8a 100644 --- a/src/basic/missing_loop.h +++ b/src/basic/missing_loop.h @@ -26,10 +26,14 @@ assert_cc(LO_FLAGS_DIRECT_IO == 16); assert_cc(LOOP_SET_DIRECT_IO == 0x4C08); #endif -#ifndef LOOP_SET_STATUS_SETTABLE_FLAGS -# define LOOP_SET_STATUS_SETTABLE_FLAGS (LO_FLAGS_AUTOCLEAR | LO_FLAGS_PARTSCAN) -#endif - #ifndef LOOP_SET_BLOCK_SIZE # define LOOP_SET_BLOCK_SIZE 0x4C09 +#else +assert_cc(LOOP_SET_BLOCK_SIZE == 0x4C09); +#endif + +#ifndef LOOP_SET_STATUS_SETTABLE_FLAGS +# define LOOP_SET_STATUS_SETTABLE_FLAGS (LO_FLAGS_AUTOCLEAR | LO_FLAGS_PARTSCAN) +#else +assert_cc(LOOP_SET_STATUS_SETTABLE_FLAGS == (LO_FLAGS_AUTOCLEAR | LO_FLAGS_PARTSCAN)); #endif From 2128085d0c85b9df2d000c551da47dfbc3374b91 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sat, 15 Jun 2024 12:55:45 +0200 Subject: [PATCH 3/3] selinux-util: make type of cleanup func void Follow-up for 6623c64a02fae52103cdc9c80dfcabec9eeaf8ba Return values are pointless for _cleanup_ functions, and this matches what we do in DEFINE_TRIVIAL_CLEANUP_FUNC(). --- src/shared/selinux-util.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/shared/selinux-util.h b/src/shared/selinux-util.h index 038456fcca..3a2cf0d850 100644 --- a/src/shared/selinux-util.h +++ b/src/shared/selinux-util.h @@ -14,9 +14,8 @@ DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(char*, freecon, NULL); #else -static inline char* freeconp(char **p) { +static inline void freeconp(char **p) { assert(*p == NULL); - return NULL; } #endif