Skip to contentSkip to conversation

serial-uclass: fix build warning

PATCH In review Heiko Schocher 2 participants 3 messages Feb 2, 2022 – Feb 8, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial-uclass: fix build warning

if CONFIG_DM_STDIO is defined but SERIAL_PRESENT not, gcc drops warnings for serial_stub_* functions that they are defined but not used.

Fix it.

---
azure build is clean
https://dev.azure.com/hs0298/hs/_build/results?buildId=78&view=results

 drivers/serial/serial-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/serial/serial-uclass.c +1 -1
index 96a1cb65ba..362cedd955 100644
@@ -357,7 +357,6 @@ static void serial_stub_putc(struct stdio_dev *sdev, const char ch)
 {
 	_serial_putc(sdev->priv, ch);
 }
-#endif
 
 static void serial_stub_puts(struct stdio_dev *sdev, const char *str)
 {
@@ -374,6 +373,7 @@ static int serial_stub_tstc(struct stdio_dev *sdev)
 	return _serial_tstc(sdev->priv);
 }
 #endif
+#endif
 
 /**
  * on_baudrate() - Update the actual baudrate when the env var changes
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Heiko Schocher

if CONFIG_DM_STDIO is defined but SERIAL_PRESENT not, gcc drops warnings for serial_stub_* functions that they are defined but not used.

Fix it.

Quoted 7 lines

---
azure build is clean
https://dev.azure.com/hs0298/hs/_build/results?buildId=78&view=results

 drivers/serial/serial-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by
#2 lore raw
Quoted 7 lines · Heiko Schocher

if CONFIG_DM_STDIO is defined but SERIAL_PRESENT not, gcc drops warnings for serial_stub_* functions that they are defined but not used.

Fix it.

Quoted 7 lines

---
azure build is clean
https://dev.azure.com/hs0298/hs/_build/results?buildId=78&view=results

 drivers/serial/serial-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-dm, thanks!