diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c index b8e3f7aadd..f4801318de 100644 --- a/src/core/kmod-setup.c +++ b/src/core/kmod-setup.c @@ -113,12 +113,11 @@ static bool in_qemu(void) { int kmod_setup(void) { #if HAVE_KMOD - static const struct { const char *module; const char *path; - bool warn_if_unavailable:1; - bool warn_if_module:1; + bool warn_if_unavailable; + bool warn_if_module; bool (*condition_fn)(void); } kmod_table[] = { /* This one we need to load explicitly, since auto-loading on use doesn't work @@ -166,23 +165,23 @@ int kmod_setup(void) { { "tpm", "/sys/class/tpmrm", false, false, efi_has_tpm2 }, #endif }; - _cleanup_(kmod_unrefp) struct kmod_ctx *ctx = NULL; - unsigned i; if (have_effective_cap(CAP_SYS_MODULE) <= 0) return 0; - for (i = 0; i < ELEMENTSOF(kmod_table); i++) { - if (kmod_table[i].path && access(kmod_table[i].path, F_OK) >= 0) + _cleanup_(kmod_unrefp) struct kmod_ctx *ctx = NULL; + + FOREACH_ARRAY(kmod, kmod_table, ELEMENTSOF(kmod_table)) { + if (kmod->path && access(kmod->path, F_OK) >= 0) continue; - if (kmod_table[i].condition_fn && !kmod_table[i].condition_fn()) + if (kmod->condition_fn && !kmod->condition_fn()) continue; - if (kmod_table[i].warn_if_module) + if (kmod->warn_if_module) log_debug("Your kernel apparently lacks built-in %s support. Might be " "a good idea to compile it in. We'll now try to work around " - "this by loading the module...", kmod_table[i].module); + "this by loading the module...", kmod->module); if (!ctx) { ctx = kmod_new(NULL, NULL); @@ -193,7 +192,7 @@ int kmod_setup(void) { kmod_load_resources(ctx); } - (void) module_load_and_warn(ctx, kmod_table[i].module, kmod_table[i].warn_if_unavailable); + (void) module_load_and_warn(ctx, kmod->module, kmod->warn_if_unavailable); } #endif diff --git a/src/login/logind-session.h b/src/login/logind-session.h index b36d422141..f344fb6a61 100644 --- a/src/login/logind-session.h +++ b/src/login/logind-session.h @@ -135,16 +135,16 @@ struct Session { sd_event_source *fifo_event_source; sd_event_source *leader_pidfd_event_source; - bool idle_hint; - dual_timestamp idle_hint_timestamp; + bool in_gc_queue; + bool started; + bool stopping; + + bool was_active; bool locked_hint; - bool in_gc_queue:1; - bool started:1; - bool stopping:1; - - bool was_active:1; + bool idle_hint; + dual_timestamp idle_hint_timestamp; sd_bus_message *create_message; /* The D-Bus message used to create the session, which we haven't responded to yet */ sd_bus_message *upgrade_message; /* The D-Bus message used to upgrade the session class user-incomplete → user, which we haven't responded to yet */ diff --git a/src/systemctl/systemctl-show.c b/src/systemctl/systemctl-show.c index 5bb8ad9fa0..e81afee058 100644 --- a/src/systemctl/systemctl-show.c +++ b/src/systemctl/systemctl-show.c @@ -204,7 +204,7 @@ typedef struct UnitStatusInfo { pid_t control_pid; const char *status_text; const char *pid_file; - bool running:1; + bool running; int status_errno; uint32_t fd_store_max; diff --git a/src/sysupdate/sysupdate-partition.h b/src/sysupdate/sysupdate-partition.h index 672eb93e90..094d8e0ca4 100644 --- a/src/sysupdate/sysupdate-partition.h +++ b/src/sysupdate/sysupdate-partition.h @@ -29,9 +29,9 @@ struct PartitionInfo { sd_id128_t type, uuid; char *label; char *device; /* Note that this might point to some non-existing path in case we operate on a loopback file */ - bool no_auto:1; - bool read_only:1; - bool growfs:1; + bool no_auto; + bool read_only; + bool growfs; }; #define PARTITION_INFO_NULL \ diff --git a/src/timesync/timesyncd-manager.h b/src/timesync/timesyncd-manager.h index f444787489..027ec52dac 100644 --- a/src/timesync/timesyncd-manager.h +++ b/src/timesync/timesyncd-manager.h @@ -45,10 +45,9 @@ struct Manager { LIST_HEAD(ServerName, runtime_servers); LIST_HEAD(ServerName, fallback_servers); - bool have_fallbacks:1; - RateLimit ratelimit; bool exhausted_servers; + bool have_fallbacks; /* network */ sd_event_source *network_event_source; diff --git a/src/timesync/timesyncd-server.h b/src/timesync/timesyncd-server.h index e22917aa12..a4b5637731 100644 --- a/src/timesync/timesyncd-server.h +++ b/src/timesync/timesyncd-server.h @@ -30,11 +30,11 @@ struct ServerAddress { struct ServerName { Manager *manager; + bool marked; + ServerType type; char *string; - bool marked:1; - LIST_HEAD(ServerAddress, addresses); LIST_FIELDS(ServerName, names); };