From 801ac5ced83c69aa4402afaaee708ad0652efc6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Fri, 28 Feb 2025 22:51:39 +0100 Subject: [PATCH] pipewire: module-rt: simplify `check_rtkit()` The return value is always 0, and the `impl` parameter is not used, so ues the return value to return the boolean result instead of an out parameter, and get rid of the unused argument. --- src/modules/module-rt.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/modules/module-rt.c b/src/modules/module-rt.c index 96499cf8c..5397dec7c 100644 --- a/src/modules/module-rt.c +++ b/src/modules/module-rt.c @@ -920,19 +920,17 @@ static const struct spa_thread_utils_methods impl_thread_utils = { #ifdef HAVE_DBUS -static int check_rtkit(struct impl *impl, struct pw_context *context, bool *can_use_rtkit) +static bool check_rtkit(struct pw_context *context) { const struct pw_properties *context_props; const char *str; - *can_use_rtkit = true; - if ((context_props = pw_context_get_properties(context)) != NULL && (str = pw_properties_get(context_props, "support.dbus")) != NULL && !pw_properties_parse_bool(str)) - *can_use_rtkit = false; + return false; - return 0; + return true; } static int rtkit_get_bus(struct impl *impl) @@ -1118,9 +1116,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) pthread_mutex_init(&impl->lock, NULL); pthread_cond_init(&impl->cond, NULL); - if ((res = check_rtkit(impl, context, &can_use_rtkit)) < 0) - goto error; - + can_use_rtkit = check_rtkit(context); #endif /* If the user has permissions to use regular realtime scheduling, as well as * the nice level we want, then we'll use that instead of RTKit */