From: Mike Yuan Date: Tue, 26 Mar 2024 16:30:06 +0000 (+0800) Subject: sleep-config: make sleep_operation_is_hibernation uppercase X-Git-Tag: v256-rc1~361^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=792dd6f46c285a0d3434c5caa4a9a80a8823cc3b;p=thirdparty%2Fsystemd.git sleep-config: make sleep_operation_is_hibernation uppercase --- 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;