diff --git a/src/runner.c b/src/runner.c
index b851ea84ddcd3f4bc28028105a65546ff0760b10..b3f8feb7475aa1c5604c7170d751807bfcb6628c 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -436,6 +436,7 @@ void runner_do_init(struct runner *r, struct cell *c, int timer) {
  * @param c The cell.
  */
 void runner_do_extra_ghost(struct runner *r, struct cell *c) {
+#ifdef HYDRO_EXTRA_LOOP
   struct part *restrict parts = c->parts;
   const int count = c->count;
   const int ti_current = r->e->ti_current;
@@ -460,6 +461,7 @@ void runner_do_extra_ghost(struct runner *r, struct cell *c) {
       }
     }
   }
+#endif
 }
 
 /**