title: How to pass custom argument to linux timer's function?
body: <p>Upon some conditions, I want to schedule a timer (<code>struct timer_list</code>) that works on custom data. The <code>function</code> field of this structure holds the actual function that will be triggered, and is defined as below :</p>
  
  <pre class="lang-c prettyprint-override"><code>void (*function)(unsigned long);
  </code></pre>
  
  <p>The thing is I want to pass a pointer instead of the <code>unsigned long</code>. I know that depending on the architecture, the int-ptr conversion may or may not be safe, but I could not find if all the architectures align <code>long</code> integers with pointers so here is my question (in fact, a two-in-one) :</p>
  
  <p>Is it safe to perform a <code>long</code> to <code>void*</code> cast ? If no, how should I handle the <code>unsigned long</code> argument to get the data pointer I want in the timer function ?</p>