title: Question about round_up macro
body: <pre><code>#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
  </code></pre>
  
  <p>With the above macro, could someone please help me on understanding the "(s)-1" part, why's that?</p>
  
  <p>and also macros like:</p>
  
  <pre><code>#define PAGE_ROUND_DOWN(x) (((ULONG_PTR)(x)) &amp; (~(PAGE_SIZE-1)))
  #define PAGE_ROUND_UP(x) ( (((ULONG_PTR)(x)) + PAGE_SIZE-1)  &amp; (~(PAGE_SIZE-1)) ) 
  </code></pre>
  
  <p>I know the "(~(PAGE_SIZE-1)))" part will zero out the last five bits, but other than that I'm clueless, especially the role '&amp;' operator plays.</p>
  
  <p>Thanks,</p>