Index: kernel/generic/src/synch/workqueue.c
===================================================================
--- kernel/generic/src/synch/workqueue.c	(revision 3ac5086e0b5b6d93c26f2b1c150344366e5478e8)
+++ kernel/generic/src/synch/workqueue.c	(revision b7acf383016ce70e70a5c0df4f6ed935e25629fe)
@@ -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
-}
 
 /** @}
