summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/pic32_uart.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2022-05-03 09:31:18 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-05-05 23:39:18 +0300
commit412314720aec9226e7e423395d27ca17d5dd3b24 (patch)
tree0143cd4c62f32a15bce9b7e968ef4b9b1a091950 /drivers/tty/serial/pic32_uart.c
parent343f23cfc22b1d1577289db694f6896d1ac26594 (diff)
downloadlinux-412314720aec9226e7e423395d27ca17d5dd3b24.tar.xz
serial: pic32: convert to_pic32_sport() to an inline
'c' is not in wrapped in parentheses in the to_pic32_sport() macro, so it might be problematic wrt macro expansion. Using an inline is always safer in these cases. Both type-wise and macro-expansion-wise. So switch the macro to an inline. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20220503063122.20957-8-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/pic32_uart.c')
-rw-r--r--drivers/tty/serial/pic32_uart.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c
index 32a86b12f203..c3b4fd0b5b76 100644
--- a/drivers/tty/serial/pic32_uart.c
+++ b/drivers/tty/serial/pic32_uart.c
@@ -72,7 +72,11 @@ struct pic32_sport {
struct device *dev;
};
-#define to_pic32_sport(c) container_of(c, struct pic32_sport, port)
+
+static inline struct pic32_sport *to_pic32_sport(struct uart_port *port)
+{
+ return container_of(port, struct pic32_sport, port);
+}
static inline void pic32_uart_writel(struct pic32_sport *sport,
u32 reg, u32 val)