title: Calling mod_timer from inside timer callback function
body: <p>I'm writing a kernel module for linux, and I want my timer to re-set itself. To this end, I thought to call <code>mod_timer</code> from inside the timer's callback function, as shown:</p>
  
  <pre><code>static void sched_send(unsigned long data)
  {
      send_now();
      mod_timer(&amp;test_timer, jiffies+(get_interval()*HZ));
  }
  
  static void timer_start(void)
  {
      set_log_msg("Meep meep!");
  
      test_timer.function = sched_send;
      test_timer.expires = jiffies + HZ*get_interval();
  }
  </code></pre>
  
  <p>However, I've read <code>mod_timer</code> deletes the timer and re-adds it. Will it cause problems? If so, is there a better way to create a repeating timer for kernel modules?</p>