Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: gdm724x: Replace macro GDM_TTY_READY with static inline function

Replace the macro GDM_TTY_READY with a static inline function
to follow the Linux kernel coding style.

Signed-off-by: Brent Pappas <bpappas@pappasbrent.com>
Link: https://lore.kernel.org/r/20221117195443.19616-1-bpappas@pappasbrent.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Brent Pappas and committed by
Greg Kroah-Hartman
2b7962bd 357057ee

+8 -5
+8 -5
drivers/staging/gdm724x/gdm_tty.c
··· 21 21 22 22 #define MUX_TX_MAX_SIZE 2048 23 23 24 - #define GDM_TTY_READY(gdm) (gdm && gdm->tty_dev && gdm->port.count) 24 + static inline bool gdm_tty_ready(struct gdm *gdm) 25 + { 26 + return gdm && gdm->tty_dev && gdm->port.count; 27 + } 25 28 26 29 static struct tty_driver *gdm_driver[TTY_MAX_COUNT]; 27 30 static struct gdm *gdm_table[TTY_MAX_COUNT][GDM_TTY_MINOR]; ··· 116 113 { 117 114 struct gdm *gdm = tty_dev->gdm[index]; 118 115 119 - if (!GDM_TTY_READY(gdm)) { 116 + if (!gdm_tty_ready(gdm)) { 120 117 if (complete == RECV_PACKET_PROCESS_COMPLETE) 121 118 gdm->tty_dev->recv_func(gdm->tty_dev->priv_dev, 122 119 gdm_tty_recv_complete); ··· 143 140 { 144 141 struct gdm *gdm = arg; 145 142 146 - if (!GDM_TTY_READY(gdm)) 143 + if (!gdm_tty_ready(gdm)) 147 144 return; 148 145 149 146 tty_port_tty_wakeup(&gdm->port); ··· 157 154 int sent_len = 0; 158 155 int sending_len = 0; 159 156 160 - if (!GDM_TTY_READY(gdm)) 157 + if (!gdm_tty_ready(gdm)) 161 158 return -ENODEV; 162 159 163 160 if (!len) ··· 184 181 { 185 182 struct gdm *gdm = tty->driver_data; 186 183 187 - if (!GDM_TTY_READY(gdm)) 184 + if (!gdm_tty_ready(gdm)) 188 185 return 0; 189 186 190 187 return WRITE_SIZE;