From 792dd6f46c285a0d3434c5caa4a9a80a8823cc3b Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Wed, 27 Mar 2024 00:30:06 +0800 Subject: [PATCH] sleep-config: make sleep_operation_is_hibernation uppercase --- src/shared/sleep-config.c | 2 +- src/shared/sleep-config.h | 2 +- src/sleep/sleep.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c index c96f8485ddd..5f51ab45dea 100644 --- a/src/shared/sleep-config.c +++ b/src/shared/sleep-config.c @@ -341,7 +341,7 @@ static int sleep_supported_internal( return false; } - if (sleep_operation_is_hibernation(operation)) { + if (SLEEP_OPERATION_IS_HIBERNATION(operation)) { r = sleep_mode_supported(sleep_config->modes[operation]); if (r < 0) return r; diff --git a/src/shared/sleep-config.h b/src/shared/sleep-config.h index bc5aeb91bd6..93811c63a21 100644 --- a/src/shared/sleep-config.h +++ b/src/shared/sleep-config.h @@ -20,7 +20,7 @@ typedef enum SleepOperation { const char* sleep_operation_to_string(SleepOperation s) _const_; SleepOperation sleep_operation_from_string(const char *s) _pure_; -static inline bool sleep_operation_is_hibernation(SleepOperation operation) { +static inline bool SLEEP_OPERATION_IS_HIBERNATION(SleepOperation operation) { return IN_SET(operation, SLEEP_HIBERNATE, SLEEP_HYBRID_SLEEP); } diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c index 0f619ce0f5f..bdba4284bf1 100644 --- a/src/sleep/sleep.c +++ b/src/sleep/sleep.c @@ -238,7 +238,7 @@ static int execute( return log_error_errno(errno, "Failed to open /sys/power/state: %m"); /* Configure hibernation settings if we are supposed to hibernate */ - if (sleep_operation_is_hibernation(operation)) { + if (SLEEP_OPERATION_IS_HIBERNATION(operation)) { _cleanup_(hibernation_device_done) HibernationDevice hibernation_device = {}; bool resume_set; @@ -301,7 +301,7 @@ static int execute( return 0; fail: - if (sleep_operation_is_hibernation(operation)) + if (SLEEP_OPERATION_IS_HIBERNATION(operation)) clear_efi_hibernate_location_and_warn(); return r; -- 2.47.3