serial-uartlite: un-constify uartlite_be/uartlite_le
Subsystems (2)
PATCH 1/1 serial-uartlite: un-constify uartlite_be/uartlite_le
The patch to make uartlite_be/uartlite_le const was well-intended but caused a new build warning:
tty/serial/uartlite.c: In function 'ulite_request_port':tty/serial/uartlite.c:348:21: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] tty/serial/uartlite.c:354:22: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
It would be nice to allow passing const pointers through port->private_data, but that would be way more work, so this reverts part of the original commit for now.
A possible alternative might be to pass a structure in the private_data that contains a const pointer to the operations, which introduces a little extra overhead, or we could just add a cast to a non-const pointer, I'll leave that to the maintainer.
--- drivers/tty/serial/uartlite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/uartlite.c +2 -2
@@ -72,7 +72,7 @@ static void uartlite_outbe32(u32 val, void __iomem *addr)iowrite32be (val, addr); } -static const struct uartlite_reg_ops uartlite_be = { +static struct uartlite_reg_ops uartlite_be = { .in = uartlite_inbe32, .out = uartlite_outbe32, };
@@ -87,7 +87,7 @@ static void uartlite_outle32(u32 val, void __iomem *addr)iowrite32 (val, addr); } -static const struct uartlite_reg_ops uartlite_le = { +static struct uartlite_reg_ops uartlite_le = { .in = uartlite_inle32, .out = uartlite_outle32, };
Signature · 1 line
2.7.0