From 8048d1411f994499ef9ca82079efb03a54211cfa Mon Sep 17 00:00:00 2001
From: Ramiro Polla <ramiropolla@users.noreply.github.com>
Date: Fri, 9 Apr 2021 04:05:31 +0200
Subject: [PATCH] Drop return value from Serial::write() (#21567)

---
 Marlin/src/HAL/AVR/MarlinSerial.cpp | 5 ++---
 Marlin/src/HAL/AVR/MarlinSerial.h   | 2 +-
 Marlin/src/core/serial_base.h       | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/Marlin/src/HAL/AVR/MarlinSerial.cpp b/Marlin/src/HAL/AVR/MarlinSerial.cpp
index 81503e1fe9..7cd4446987 100644
--- a/Marlin/src/HAL/AVR/MarlinSerial.cpp
+++ b/Marlin/src/HAL/AVR/MarlinSerial.cpp
@@ -454,7 +454,7 @@ void MarlinSerial<Cfg>::flush() {
 }
 
 template<typename Cfg>
-size_t MarlinSerial<Cfg>::write(const uint8_t c) {
+void MarlinSerial<Cfg>::write(const uint8_t c) {
   if (Cfg::TX_SIZE == 0) {
 
     _written = true;
@@ -480,7 +480,7 @@ size_t MarlinSerial<Cfg>::write(const uint8_t c) {
       // location". This makes sure flush() won't return until the bytes
       // actually got written
       B_TXC = 1;
-      return 1;
+      return;
     }
 
     const uint8_t i = (tx_buffer.head + 1) & (Cfg::TX_SIZE - 1);
@@ -510,7 +510,6 @@ size_t MarlinSerial<Cfg>::write(const uint8_t c) {
     // Enable TX ISR - Non atomic, but it will eventually enable TX ISR
     B_UDRIE = 1;
   }
-  return 1;
 }
 
 template<typename Cfg>
diff --git a/Marlin/src/HAL/AVR/MarlinSerial.h b/Marlin/src/HAL/AVR/MarlinSerial.h
index 31bbaaa531..355ecd41fd 100644
--- a/Marlin/src/HAL/AVR/MarlinSerial.h
+++ b/Marlin/src/HAL/AVR/MarlinSerial.h
@@ -210,7 +210,7 @@
     static int read();
     static void flush();
     static ring_buffer_pos_t available();
-    static size_t write(const uint8_t c);
+    static void write(const uint8_t c);
     static void flushTX();
     #if HAS_DGUS_LCD
       static ring_buffer_pos_t get_tx_buffer_free();
diff --git a/Marlin/src/core/serial_base.h b/Marlin/src/core/serial_base.h
index 8b23816b17..d8090eb83a 100644
--- a/Marlin/src/core/serial_base.h
+++ b/Marlin/src/core/serial_base.h
@@ -100,7 +100,7 @@ struct SerialBase {
 
   // Static dispatch methods below:
   // The most important method here is where it all ends to:
-  size_t write(uint8_t c)           { return SerialChild->write(c); }
+  void write(uint8_t c)             { SerialChild->write(c); }
 
   // Called when the parser finished processing an instruction, usually build to nothing
   void msgDone() const              { SerialChild->msgDone(); }