]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sleep-config: make sleep_operation_is_hibernation uppercase
authorMike Yuan <me@yhndnzj.com>
Tue, 26 Mar 2024 16:30:06 +0000 (00:30 +0800)
committerMike Yuan <me@yhndnzj.com>
Thu, 28 Mar 2024 09:16:21 +0000 (17:16 +0800)
src/shared/sleep-config.c
src/shared/sleep-config.h
src/sleep/sleep.c

index c96f8485ddd5433b66536468f2f1198af84f6598..5f51ab45dea6b89f13162731a7830c2be142be9b 100644 (file)
@@ -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;
index bc5aeb91bd62f78d80cadf43c3a4c58ae0b66320..93811c63a2110c373b394ae576dce35d6fa54af9 100644 (file)
@@ -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);
 }
 
index 0f619ce0f5fc22d7ef233c2dcc89f1146aba5012..bdba4284bf146e060e22bcbbda6ce3557f813142 100644 (file)
@@ -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;