Several Coverity fixes (#37253)

This commit is contained in:
Mike Yuan
2025-04-26 16:58:54 +02:00
committed by GitHub
4 changed files with 4 additions and 4 deletions

View File

@@ -364,7 +364,7 @@ static const struct {
static int device_found_to_string_many(DeviceFound flags, char **ret) {
_cleanup_free_ char *s = NULL;
assert(flags >= 0);
assert((flags & ~_DEVICE_FOUND_MASK) == 0);
assert(ret);
FOREACH_ELEMENT(i, device_found_map) {

View File

@@ -4070,8 +4070,7 @@ int journal_file_open(
int r;
assert(fd >= 0 || fname);
assert(file_flags >= 0);
assert(file_flags <= _JOURNAL_FILE_FLAGS_MAX);
assert((file_flags & ~_JOURNAL_FILE_FLAGS_ALL) == 0);
assert(mmap_cache);
assert(ret);

View File

@@ -132,7 +132,7 @@ typedef enum JournalFileFlags {
JOURNAL_COMPRESS = 1 << 0,
JOURNAL_SEAL = 1 << 1,
JOURNAL_STRICT_ORDER = 1 << 2,
_JOURNAL_FILE_FLAGS_MAX = JOURNAL_COMPRESS|JOURNAL_SEAL|JOURNAL_STRICT_ORDER,
_JOURNAL_FILE_FLAGS_ALL = JOURNAL_COMPRESS|JOURNAL_SEAL|JOURNAL_STRICT_ORDER,
} JournalFileFlags;
typedef struct {

View File

@@ -86,6 +86,7 @@ typedef enum TableErsatz {
TABLE_ERSATZ_UNSET,
TABLE_ERSATZ_NA,
_TABLE_ERSATZ_MAX,
_TABLE_ERSATZ_INVALID = -EINVAL,
} TableErsatz;
typedef struct Table Table;