Nest all namespaces

The compiler supports this now.  We can type less going forward.
No functional changes.

Signed-off-by: Stephan Pleines <pleines.stephan@gmail.com>
Change-Id: I29d6fa4f9aacc0e381f1a7637294db0392466995
diff --git a/motors/peripheral/adc.cc b/motors/peripheral/adc.cc
index 64f1557..11a91ff 100644
--- a/motors/peripheral/adc.cc
+++ b/motors/peripheral/adc.cc
@@ -2,8 +2,7 @@
 
 #include "motors/core/kinetis.h"
 
-namespace frc971 {
-namespace motors {
+namespace frc971::motors {
 namespace {
 
 #define ADC_SC2_BASE \
@@ -58,5 +57,4 @@
   ADC_INIT_SINGLE(1, (adc1_channels == AdcChannels::kB) ? ADC_CFG2_MUXSEL : 0);
 }
 
-}  // namespace motors
-}  // namespace frc971
+}  // namespace frc971::motors
diff --git a/motors/peripheral/adc_dma.cc b/motors/peripheral/adc_dma.cc
index 15d50eb..11cdbb6 100644
--- a/motors/peripheral/adc_dma.cc
+++ b/motors/peripheral/adc_dma.cc
@@ -52,8 +52,7 @@
 //   8. Read ADC0.RB and ADC1.RB
 //   9. Go back to step #3
 
-namespace frc971 {
-namespace teensy {
+namespace frc971::teensy {
 namespace {
 
 constexpr uint32_t pdb_sc(int pdb_input) {
@@ -275,5 +274,4 @@
                 V_PDB_EN(3) /* Enable our two */;
 }
 
-}  // namespace teensy
-}  // namespace frc971
+}  // namespace frc971::teensy
diff --git a/motors/peripheral/spi.cc b/motors/peripheral/spi.cc
index 8c4ad11..59ff651 100644
--- a/motors/peripheral/spi.cc
+++ b/motors/peripheral/spi.cc
@@ -4,8 +4,7 @@
 
 #include "motors/core/time.h"
 
-namespace frc971 {
-namespace teensy {
+namespace frc971::teensy {
 
 Spi::~Spi() {
   DisableTransmitInterrupt();
@@ -136,5 +135,4 @@
   return true;
 }
 
-}  // namespace teensy
-}  // namespace frc971
+}  // namespace frc971::teensy
diff --git a/motors/peripheral/uart.cc b/motors/peripheral/uart.cc
index 0617e3f..408bbfd 100644
--- a/motors/peripheral/uart.cc
+++ b/motors/peripheral/uart.cc
@@ -2,8 +2,7 @@
 
 #include <stdint.h>
 
-namespace frc971 {
-namespace teensy {
+namespace frc971::teensy {
 
 // Currently hard-coded for 8-bit + no parity + start bit + stop bit.
 void Uart::Initialize(int baud_rate) {
@@ -152,5 +151,4 @@
   }
 }
 
-}  // namespace teensy
-}  // namespace frc971
+}  // namespace frc971::teensy
diff --git a/motors/peripheral/uart_buffer_test.cc b/motors/peripheral/uart_buffer_test.cc
index 223c029..0ee5a49 100644
--- a/motors/peripheral/uart_buffer_test.cc
+++ b/motors/peripheral/uart_buffer_test.cc
@@ -2,9 +2,7 @@
 
 #include "gtest/gtest.h"
 
-namespace frc971 {
-namespace teensy {
-namespace testing {
+namespace frc971::teensy::testing {
 
 // Tests that using PushSpan with single characters works correctly.
 TEST(UartBufferTest, PushSpanSingle) {
@@ -281,6 +279,4 @@
   }
 }
 
-}  // namespace testing
-}  // namespace teensy
-}  // namespace frc971
+}  // namespace frc971::teensy::testing