Commit 0b7a2b28 authored by Jiri Slaby (SUSE)'s avatar Jiri Slaby (SUSE) Committed by Greg Kroah-Hartman
Browse files

tty: make tty_port_client_operations operate with u8



The parameters are already unsigned chars. So make them explicitly u8s,
as the rest is going to be unified to u8 eventually too.

Signed-off-by: default avatar"Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230810091510.13006-10-jirislaby@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 77b425e4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -22,8 +22,8 @@ struct serport {
 * Callback functions from the tty port.
 */

static int ttyport_receive_buf(struct tty_port *port, const unsigned char *cp,
				const unsigned char *fp, size_t count)
static int ttyport_receive_buf(struct tty_port *port, const u8 *cp,
				const u8 *fp, size_t count)
{
	struct serdev_controller *ctrl = port->client_data;
	struct serport *serport = serdev_controller_get_drvdata(ctrl);
+2 −2
Original line number Diff line number Diff line
@@ -505,8 +505,8 @@ static void lookahead_bufs(struct tty_port *port, struct tty_buffer *head)
static int
receive_buf(struct tty_port *port, struct tty_buffer *head, int count)
{
	unsigned char *p = char_buf_ptr(head, head->read);
	const char *f = NULL;
	u8 *p = char_buf_ptr(head, head->read);
	const u8 *f = NULL;
	int n;

	if (head->flags)
+4 −5
Original line number Diff line number Diff line
@@ -20,9 +20,8 @@
#include <linux/serdev.h>
#include "tty.h"

static int tty_port_default_receive_buf(struct tty_port *port,
					const unsigned char *p,
					const unsigned char *f, size_t count)
static int tty_port_default_receive_buf(struct tty_port *port, const u8 *p,
					const u8 *f, size_t count)
{
	int ret;
	struct tty_struct *tty;
@@ -43,8 +42,8 @@ static int tty_port_default_receive_buf(struct tty_port *port,
	return ret;
}

static void tty_port_default_lookahead_buf(struct tty_port *port, const unsigned char *p,
					   const unsigned char *f, unsigned int count)
static void tty_port_default_lookahead_buf(struct tty_port *port, const u8 *p,
					   const u8 *f, unsigned int count)
{
	struct tty_struct *tty;
	struct tty_ldisc *ld;
+4 −3
Original line number Diff line number Diff line
@@ -39,9 +39,10 @@ struct tty_port_operations {
};

struct tty_port_client_operations {
	int (*receive_buf)(struct tty_port *port, const unsigned char *, const unsigned char *, size_t);
	void (*lookahead_buf)(struct tty_port *port, const unsigned char *cp,
			      const unsigned char *fp, unsigned int count);
	int (*receive_buf)(struct tty_port *port, const u8 *cp, const u8 *fp,
			   size_t count);
	void (*lookahead_buf)(struct tty_port *port, const u8 *cp,
			      const u8 *fp, unsigned int count);
	void (*write_wakeup)(struct tty_port *port);
};