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

Configure Feed

Select the types of activity you want to include in your feed.

tty: moxa: convert to u8 and size_t

Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20231206073712.17776-18-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
cb8566b9 2573f7ea

+8 -7
+8 -7
drivers/tty/moxa.c
··· 514 514 static void MoxaPortFlowCtrl(struct moxa_port *, int, int, int, int, int); 515 515 static int MoxaPortLineStatus(struct moxa_port *); 516 516 static void MoxaPortFlushData(struct moxa_port *, int); 517 - static int MoxaPortWriteData(struct tty_struct *, const unsigned char *, int); 517 + static ssize_t MoxaPortWriteData(struct tty_struct *, const u8 *, size_t); 518 518 static int MoxaPortReadData(struct moxa_port *); 519 519 static unsigned int MoxaPortTxQueue(struct moxa_port *); 520 520 static int MoxaPortRxQueue(struct moxa_port *); ··· 1933 1933 * 1934 1934 * Function 20: Write data. 1935 1935 * Syntax: 1936 - * int MoxaPortWriteData(int port, unsigned char * buffer, int length); 1936 + * ssize_t MoxaPortWriteData(int port, u8 *buffer, size_t length); 1937 1937 * int port : port number (0 - 127) 1938 - * unsigned char * buffer : pointer to write data buffer. 1939 - * int length : write data length 1938 + * u8 *buffer : pointer to write data buffer. 1939 + * size_t length : write data length 1940 1940 * 1941 1941 * return: 0 - length : real write data length 1942 1942 * ··· 2163 2163 return val; 2164 2164 } 2165 2165 2166 - static int MoxaPortWriteData(struct tty_struct *tty, const u8 *buffer, int len) 2166 + static ssize_t MoxaPortWriteData(struct tty_struct *tty, const u8 *buffer, 2167 + size_t len) 2167 2168 { 2168 2169 struct moxa_port *port = tty->driver_data; 2169 2170 void __iomem *baseAddr, *ofsAddr, *ofs; 2170 - unsigned int c, total; 2171 + size_t c, total; 2171 2172 u16 head, tail, tx_mask, spage, epage; 2172 2173 u16 pageno, pageofs, bufhead; 2173 2174 ··· 2225 2224 static int MoxaPortReadData(struct moxa_port *port) 2226 2225 { 2227 2226 struct tty_struct *tty = port->port.tty; 2228 - unsigned char *dst; 2229 2227 void __iomem *baseAddr, *ofsAddr, *ofs; 2228 + u8 *dst; 2230 2229 unsigned int count, len, total; 2231 2230 u16 tail, rx_mask, spage, epage; 2232 2231 u16 pageno, pageofs, bufhead, head;