From f2330acda408a34451d5e15380fcdd225a672473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 13 Jun 2019 18:03:14 +0200 Subject: [PATCH] logind: remove unused check All callers pass either a fixed action, or HANDLE_IGNORE is explicitly filtered out. Let's remove this case here, because we cannot properly log what opreation we are ignoring. --- src/login/logind-action.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/login/logind-action.c b/src/login/logind-action.c index 4f97e0d9bb..f6de918c4d 100644 --- a/src/login/logind-action.c +++ b/src/login/logind-action.c @@ -61,12 +61,8 @@ int manager_handle_action( int r; assert(m); - - /* If the key handling is turned off, don't do anything */ - if (handle == HANDLE_IGNORE) { - log_debug("Refusing operation, as it is turned off."); - return 0; - } + /* We should be called only with valid actions different than HANDLE_IGNORE. */ + assert(handle > HANDLE_IGNORE && handle < _HANDLE_ACTION_MAX); if (inhibit_key == INHIBIT_HANDLE_LID_SWITCH) { /* If the last system suspend or startup is too close,