Index: kernel/generic/src/adt/cht.c
===================================================================
--- kernel/generic/src/adt/cht.c	(revision 69146b93ef5ca7beba675e46730ac8d6d5a24316)
+++ kernel/generic/src/adt/cht.c	(revision d54b3038b92866093ccc24cde1eeb71018e2cb00)
@@ -298,4 +298,10 @@
 #include <synch/rcu.h>
 
+#ifdef CONFIG_DEBUG
+/* Do not enclose in parentheses. */
+#define DBG(x) x
+#else
+#define DBG(x)
+#endif
 
 /* Logarithm of the min bucket count. Must be at least 3. 2^6 == 64 buckets. */
@@ -1755,11 +1761,12 @@
 	
 	cht_link_t *next = get_next(*psrc_head);
-	marked_ptr_t ret;
-	
-	ret = cas_link(pdest_head, &sentinel, N_INVALID, next, N_NORMAL);
+
+	DBG(marked_ptr_t ret = )
+		cas_link(pdest_head, &sentinel, N_INVALID, next, N_NORMAL);
 	ASSERT(ret == make_link(&sentinel, N_INVALID) || (N_NORMAL == get_mark(ret)));
 	cas_order_barrier();
 	
-	ret = cas_link(psrc_head, next, N_CONST, next, N_INVALID);	
+	DBG(ret = ) 
+		cas_link(psrc_head, next, N_CONST, next, N_INVALID);	
 	ASSERT(ret == make_link(next, N_CONST) || (N_INVALID == get_mark(ret)));
 	cas_order_barrier();
@@ -1853,5 +1860,5 @@
 	
 	/* Link the dest head to the second part of the split. */
-	marked_ptr_t ret = 
+	DBG(marked_ptr_t ret = )
 		cas_link(pdest_head, &sentinel, N_INVALID, wnd.cur, N_NORMAL);
 	ASSERT(ret == make_link(&sentinel, N_INVALID) || (N_NORMAL == get_mark(ret)));
@@ -2033,5 +2040,5 @@
 	} 
 	
-	marked_ptr_t ret = 
+	DBG(marked_ptr_t ret = )
 		cas_link(psrc_head, join_node, N_CONST, join_node, N_INVALID);
 	ASSERT(ret == make_link(join_node, N_CONST) || (N_INVALID == get_mark(ret)));
Index: kernel/generic/src/synch/workqueue.c
===================================================================
--- kernel/generic/src/synch/workqueue.c	(revision 69146b93ef5ca7beba675e46730ac8d6d5a24316)
+++ kernel/generic/src/synch/workqueue.c	(revision d54b3038b92866093ccc24cde1eeb71018e2cb00)
@@ -139,7 +139,9 @@
 static void cv_wait(struct work_queue *workq);
 static void nonblock_init(void);
+
+#ifdef CONFIG_DEBUG
 static bool workq_corrupted(struct work_queue *workq);
 static bool work_item_corrupted(work_t *work_item);
-
+#endif
 
 /** Creates worker thread for the system-wide worker queue. */
@@ -204,5 +206,7 @@
 	irq_spinlock_lock(&workq->lock, true);
 	bool stopped = workq->stopping;
+#ifdef CONFIG_DEBUG
 	size_t running_workers = workq->cur_worker_cnt;
+#endif
 	irq_spinlock_unlock(&workq->lock, true);
 	
@@ -940,4 +944,5 @@
 }
 
+#ifdef CONFIG_DEBUG
 /** Returns true if the workq is definitely corrupted; false if not sure. 
  * 
@@ -946,5 +951,4 @@
 static bool workq_corrupted(struct work_queue *workq)
 {
-#ifdef CONFIG_DEBUG
 	/* 
 	 * Needed to make the most current cookie value set by workq_preinit()
@@ -955,21 +959,15 @@
 	memory_barrier();
 	return NULL == workq || workq->cookie != WORKQ_MAGIC;
-#else
-	return false;
+}
+
+/** Returns true if the work_item is definitely corrupted; false if not sure. 
+ * 
+ * Must be used with the work queue protecting spinlock locked.
+ */
+static bool work_item_corrupted(work_t *work_item)
+{
+	return NULL == work_item || work_item->cookie != WORK_ITEM_MAGIC;
+}
 #endif
-}
-
-/** Returns true if the work_item is definitely corrupted; false if not sure. 
- * 
- * Must be used with the work queue protecting spinlock locked.
- */
-static bool work_item_corrupted(work_t *work_item)
-{
-#ifdef CONFIG_DEBUG
-	return NULL == work_item || work_item->cookie != WORK_ITEM_MAGIC;
-#else
-	return false;
-#endif
-}
 
 /** @}
