title: (x | y) - y why can't it simply be x or even `x | 0`
body: <p>I was reading a kernel code, and in one place I've seen an expression inside <code>if</code> statement like</p>
  
  <pre><code>if (value == (SPINLOCK_SHARED | 1) - 1) {
           ............
  }
  </code></pre>
  
  <p>where <code>SPINLOCK_SHARED = 0x80000000</code> is a predefined constant. </p>
  
  <p>I wonder why do we need <code>(SPINLOCK_SHARED | 1) - 1</code> - for type conversion purpose? the result of the expression would be 80000000-- same as 0x80000000, is it not? yet, why ORing 1 and Subtracting 1 matters?</p>
  
  <p>Have a feeling like I am missing to get something..</p>