From 1fb2fffdbf14c8970d57c8a59310539c814bca89 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Tue, 23 Jun 2020 18:49:45 -0500
Subject: [PATCH] General cleanup

---
 Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp |  2 +-
 Marlin/src/gcode/feature/i2c/M260_M261.cpp |  2 +-
 Marlin/src/gcode/gcode.cpp                 | 17 ++++-------------
 3 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp b/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp
index 3e74203aecf..e0726c7cd59 100644
--- a/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp
+++ b/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp
@@ -336,7 +336,7 @@ uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data) {
  * @brief  Erases PAGE and PAGE1 and writes VALID_PAGE header to PAGE
  * @param  None
  * @retval Status of the last operation (Flash write or erase) done during
- *         EEPROM formating
+ *         EEPROM formatting
  */
 static HAL_StatusTypeDef EE_Format() {
   FLASH_EraseInitTypeDef pEraseInit;
diff --git a/Marlin/src/gcode/feature/i2c/M260_M261.cpp b/Marlin/src/gcode/feature/i2c/M260_M261.cpp
index ea04d2a293d..13406f36005 100644
--- a/Marlin/src/gcode/feature/i2c/M260_M261.cpp
+++ b/Marlin/src/gcode/feature/i2c/M260_M261.cpp
@@ -31,7 +31,7 @@
 /**
  * M260: Send data to a I2C slave device
  *
- * This is a PoC, the formating and arguments for the GCODE will
+ * This is a PoC, the formatting and arguments for the GCODE will
  * change to be more compatible, the current proposal is:
  *
  *  M260 A<slave device address base 10> ; Sets the I2C slave address the data will be sent to
diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp
index 960acc30408..2ff25057db9 100644
--- a/Marlin/src/gcode/gcode.cpp
+++ b/Marlin/src/gcode/gcode.cpp
@@ -327,13 +327,8 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
 
       #if ENABLED(G38_PROBE_TARGET)
         case 38:                                                  // G38.2, G38.3: Probe towards target
-          if (WITHIN(parser.subcode, 2,
-            #if ENABLED(G38_PROBE_AWAY)
-              5
-            #else
-              3
-            #endif
-          )) G38(parser.subcode);                                 // G38.4, G38.5: Probe away from target
+          if (WITHIN(parser.subcode, 2, TERN(G38_PROBE_AWAY, 5, 3)))
+            G38(parser.subcode);                                  // G38.4, G38.5: Probe away from target
           break;
       #endif
 
@@ -485,14 +480,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
         case 108: M108(); break;                                  // M108: Cancel Waiting
         case 112: M112(); break;                                  // M112: Full Shutdown
         case 410: M410(); break;                                  // M410: Quickstop - Abort all the planned moves.
-        #if ENABLED(HOST_PROMPT_SUPPORT)
-          case 876: M876(); break;                                // M876: Handle Host prompt responses
-        #endif
+        TERN_(HOST_PROMPT_SUPPORT, case 876:)                     // M876: Handle Host prompt responses
       #else
         case 108: case 112: case 410:
-        #if ENABLED(HOST_PROMPT_SUPPORT)
-          case 876:
-        #endif
+        TERN_(HOST_PROMPT_SUPPORT, case 876:)
         break;
       #endif