From 47a0813561afb06ba6b681dfcd4d2224847e3962 Mon Sep 17 00:00:00 2001 From: Benjamin Gwin Date: Thu, 8 Aug 2024 21:27:06 +0000 Subject: [PATCH] drivers: serial: pl011: Fix ignored const qualifiers When trying to build Zephyr with -Wignored-qualifiers this leads to a compiler warning like: zephyr/drivers/serial/uart_pl011_registers.h:40:1: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers] Since the return value is copied by the caller, making it const has no effect and the compiler warns that this is being ignored. This enables applications to build with additional compiler warnings turned on. Signed-off-by: Benjamin Gwin --- drivers/serial/uart_pl011_registers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/serial/uart_pl011_registers.h b/drivers/serial/uart_pl011_registers.h index 7340dd909af..6f559d0041b 100644 --- a/drivers/serial/uart_pl011_registers.h +++ b/drivers/serial/uart_pl011_registers.h @@ -37,9 +37,9 @@ struct pl011_regs { }; static inline -volatile struct pl011_regs *const get_uart(const struct device *dev) +volatile struct pl011_regs *get_uart(const struct device *dev) { - return (volatile struct pl011_regs *const)DEVICE_MMIO_GET(dev); + return (volatile struct pl011_regs *)DEVICE_MMIO_GET(dev); } #define PL011_BIT_MASK(x, y) (((2 << x) - 1) << y)