From 06a50ce58c35f9fcf659ef93680015384e4866af Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sun, 9 Dec 2012 13:44:52 +0100 Subject: [PATCH] kmscon: remove unused 'out' arguments We don't use the newly created objects so no need to return them. Furthermore, we want the functions to already perform actions on the objects so there is no guarantee the objects are still alive after function return. Thus, simply return nothing. Signed-off-by: David Herrmann --- src/kmscon_main.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/kmscon_main.c b/src/kmscon_main.c index c50b1a1..07b73ee 100644 --- a/src/kmscon_main.c +++ b/src/kmscon_main.c @@ -144,8 +144,8 @@ static int app_seat_event(struct kmscon_seat *s, unsigned int event, return 0; } -static int app_seat_new(struct kmscon_app *app, struct app_seat **out, - const char *sname, struct uterm_monitor_seat *useat) +static int app_seat_new(struct kmscon_app *app, const char *sname, + struct uterm_monitor_seat *useat) { struct app_seat *seat; int ret; @@ -210,7 +210,6 @@ static int app_seat_new(struct kmscon_app *app, struct app_seat **out, uterm_monitor_set_seat_data(seat->useat, seat); shl_dlist_link(&app->seats, &seat->list); ++app->running_seats; - *out = seat; return 0; err_name: @@ -293,7 +292,6 @@ static bool app_seat_gpu_is_ignored(struct app_seat *seat, } static int app_seat_add_video(struct app_seat *seat, - struct app_video **out, unsigned int type, unsigned int flags, const char *node, @@ -365,7 +363,6 @@ static int app_seat_add_video(struct app_seat *seat, uterm_monitor_set_dev_data(vid->udev, vid); shl_dlist_link(&seat->videos, &vid->list); - *out = vid; return 0; err_video: @@ -409,7 +406,7 @@ static void app_monitor_event(struct uterm_monitor *mon, switch (ev->type) { case UTERM_MONITOR_NEW_SEAT: - ret = app_seat_new(app, &seat, ev->seat_name, ev->seat); + ret = app_seat_new(app, ev->seat_name, ev->seat); if (ret) return; break; @@ -425,7 +422,7 @@ static void app_monitor_event(struct uterm_monitor *mon, switch (ev->dev_type) { case UTERM_MONITOR_DRM: case UTERM_MONITOR_FBDEV: - ret = app_seat_add_video(seat, &vid, ev->dev_type, + ret = app_seat_add_video(seat, ev->dev_type, ev->dev_flags, ev->dev_node, ev->dev); if (ret)