Index: uspace/srv/ns/service.c
===================================================================
--- uspace/srv/ns/service.c	(revision fafb8e5dc8a80c87cf66270ca6f93d574a95471c)
+++ uspace/srv/ns/service.c	(revision 5e801dccc49faadcb18cd8ddee6200633e8f11b8)
@@ -65,7 +65,8 @@
 } hashed_iface_t;
 
-static size_t service_key_hash(void *key)
-{
-	return *(service_t *) key;
+static size_t service_key_hash(const void *key)
+{
+	const service_t *srv = key;
+	return *srv;
 }
 
@@ -78,15 +79,17 @@
 }
 
-static bool service_key_equal(void *key, const ht_link_t *item)
-{
+static bool service_key_equal(const void *key, const ht_link_t *item)
+{
+	const service_t *srv = key;
 	hashed_service_t *service =
 	    hash_table_get_inst(item, hashed_service_t, link);
 
-	return service->service == *(service_t *) key;
-}
-
-static size_t iface_key_hash(void *key)
-{
-	return *(iface_t *) key;
+	return service->service == *srv;
+}
+
+static size_t iface_key_hash(const void *key)
+{
+	const iface_t *iface = key;
+	return *iface;
 }
 
@@ -99,10 +102,11 @@
 }
 
-static bool iface_key_equal(void *key, const ht_link_t *item)
-{
+static bool iface_key_equal(const void *key, const ht_link_t *item)
+{
+	const iface_t *kiface = key;
 	hashed_iface_t *iface =
 	    hash_table_get_inst(item, hashed_iface_t, link);
 
-	return iface->iface == *(iface_t *) key;
+	return iface->iface == *kiface;
 }
 
Index: uspace/srv/ns/task.c
===================================================================
--- uspace/srv/ns/task.c	(revision fafb8e5dc8a80c87cf66270ca6f93d574a95471c)
+++ uspace/srv/ns/task.c	(revision 5e801dccc49faadcb18cd8ddee6200633e8f11b8)
@@ -54,10 +54,11 @@
 } hashed_task_t;
 
-static size_t task_key_hash(void *key)
-{
-	return *(task_id_t *)key;
-}
-
-static size_t task_hash(const ht_link_t  *item)
+static size_t task_key_hash(const void *key)
+{
+	const task_id_t *tid = key;
+	return *tid;
+}
+
+static size_t task_hash(const ht_link_t *item)
 {
 	hashed_task_t *ht = hash_table_get_inst(item, hashed_task_t, link);
@@ -65,8 +66,9 @@
 }
 
-static bool task_key_equal(void *key, const ht_link_t *item)
-{
+static bool task_key_equal(const void *key, const ht_link_t *item)
+{
+	const task_id_t *tid = key;
 	hashed_task_t *ht = hash_table_get_inst(item, hashed_task_t, link);
-	return ht->id == *(task_id_t *)key;
+	return ht->id == *tid;
 }
 
@@ -97,8 +99,8 @@
 /* label-to-id hash table operations */
 
-static size_t p2i_key_hash(void *key)
-{
-	sysarg_t label = *(sysarg_t *)key;
-	return label;
+static size_t p2i_key_hash(const void *key)
+{
+	const sysarg_t *label = key;
+	return *label;
 }
 
@@ -109,10 +111,10 @@
 }
 
-static bool p2i_key_equal(void *key, const ht_link_t *item)
-{
-	sysarg_t label = *(sysarg_t *)key;
+static bool p2i_key_equal(const void *key, const ht_link_t *item)
+{
+	const sysarg_t *label = key;
 	p2i_entry_t *entry = hash_table_get_inst(item, p2i_entry_t, link);
 
-	return (label == entry->label);
+	return (*label == entry->label);
 }
 
