sleep-config: make sleep_operation_is_hibernation uppercase

This commit is contained in:
Mike Yuan
2024-03-28 17:16:21 +08:00
parent 1eba24dac4
commit 792dd6f46c
3 changed files with 4 additions and 4 deletions
+1 -1
View 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;
+1 -1
View 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);
}
+2 -2
View 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;