title: How "save_and_cli(flag)" really works?
body: <p>I was tracing a piece of code for a program works in embedded Linux and encountered this. I couldn't google out useful information to show me how it really works. </p>
  
  <p>This piece of code is written like:</p>
  
  <pre><code>unsigned char foo(*someaddress){
  unsigned long flags = 0; //why use a long?
  flags = save_and_cli(); //what is this?
  spin_lock_irqsave(&amp;someaddress, flags);//ok, this is a spin lock
  
  ...do something...
  
  restore_flags(flags); //release something?
  spin_unlock_irqrestore(&amp;someaddress, flags);//release lock
  }
  </code></pre>
  
  <p>It seems this LONG flags' value is never changed and what is save_and_cli() function?</p>
  
  <p>Thanks if you reading this.</p>