Checking and reading bits using while loops
while (( UCSR0A &amp; (1&lt;&lt;UDRE0))  == 0) {} // NOTE THE CLOSED BRACKETS BREAK THE LOOP
UDR0 = data;

Equally:
while (!(UCSRnA &amp; (1&lt;&lt;UDREn))) 
  ; // &lt;---- NOTE THE SEMI-COLON BREAKS THE LOOP
UDR0 = data;` 
/* Put data into buffer, sends the data */
UDRn = data;

Clearer version of the code: The while loops runs with no code block in the body until the !(UCSRnA &amp; (1&lt;&lt;UDREn) condition is violated which stops the looping and runs the next line UDRn = data.
while (!(UCSRnA &amp; (1&lt;&lt;UDREn))) {
} 
UDRn = data;