From b73813615434babded859b0207a5eff0dde877b2 Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Wed, 22 Aug 2018 23:42:35 +0200 Subject: [PATCH] ratbagd: do not warn when converting invalid special action Clients e.g. ratbagctl ask for all properties, so this getter gets called often even if the button is not a special action. We do not want to send the value for an invalid special action as that is negative 1. Converting to unknown is good enough here so let's just remove the error logging and convert in silence. --- ratbagd/ratbagd-button.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ratbagd/ratbagd-button.c b/ratbagd/ratbagd-button.c index 85060260..af5e3139 100644 --- a/ratbagd/ratbagd-button.c +++ b/ratbagd/ratbagd-button.c @@ -132,11 +132,8 @@ static int ratbagd_button_get_special(sd_bus *bus, enum ratbag_button_action_special special; special = ratbag_button_get_special(button->lib_button); - if (special == RATBAG_BUTTON_ACTION_SPECIAL_INVALID) { - log_error("%s: changing button special action from INVALID to UNKNOWN\n", - ratbagd_device_get_sysname(button->device)); + if (special == RATBAG_BUTTON_ACTION_SPECIAL_INVALID) special = RATBAG_BUTTON_ACTION_SPECIAL_UNKNOWN; - } verify_unsigned_int(special);