Index: uspace/lib/ipcgfx/test/ipcgfx.c
===================================================================
--- uspace/lib/ipcgfx/test/ipcgfx.c	(revision 4c6fd56b8079778d8d40e0d5ffc6a1e8e8ad2b5b)
+++ uspace/lib/ipcgfx/test/ipcgfx.c	(revision 7470d97aaec04abd08ce2ad450cda9e6ff912bd4)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2023 Jiri Svoboda
+ * Copyright (c) 2021 Jiri Svoboda
  * All rights reserved.
  *
@@ -120,13 +120,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -157,7 +156,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -172,13 +170,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -210,7 +207,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -224,13 +220,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -255,7 +250,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -270,13 +264,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -307,7 +300,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -322,13 +314,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -359,7 +350,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -374,13 +364,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -411,7 +400,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -426,13 +414,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -463,7 +450,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -477,13 +463,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -506,7 +491,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -520,13 +504,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -549,7 +532,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -565,13 +547,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -610,7 +591,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -626,13 +606,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -676,7 +655,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -692,13 +670,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -731,7 +708,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -747,13 +723,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -793,7 +768,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -809,13 +783,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -860,7 +833,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -878,13 +850,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -930,7 +901,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -948,13 +918,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -1000,7 +969,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
@@ -1017,13 +985,12 @@
 	async_sess_t *sess;
 	ipc_gc_t *ipcgc;
-	loc_srv_t *srv;
-
-	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
-
-	// FIXME This causes this test to be non-reentrant!
-	rc = loc_server_register(test_ipcgfx_server, &srv);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = loc_service_register(srv, test_ipcgfx_svc, &sid);
+
+	async_set_fallback_port_handler(test_ipcgc_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_ipcgfx_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_ipcgfx_svc, &sid);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -1062,7 +1029,6 @@
 	async_hangup(sess);
 
-	rc = loc_service_unregister(srv, sid);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	loc_server_unregister(srv);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
