tty: gdm724x: convert counts to size_t
Unify the type of tty_operations::write() counters with the 'count' parameter. I.e. use size_t for them. This includes changing constants to UL to keep min() and avoid min_t(). Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Cc: linux-staging@lists.linux.dev Link: https://lore.kernel.org/r/20230810091510.13006-35-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cfc7c12b50
commit
c3e5c706ae
@ -17,9 +17,9 @@
|
|||||||
#define GDM_TTY_MAJOR 0
|
#define GDM_TTY_MAJOR 0
|
||||||
#define GDM_TTY_MINOR 32
|
#define GDM_TTY_MINOR 32
|
||||||
|
|
||||||
#define WRITE_SIZE 2048
|
#define WRITE_SIZE 2048UL
|
||||||
|
|
||||||
#define MUX_TX_MAX_SIZE 2048
|
#define MUX_TX_MAX_SIZE 2048UL
|
||||||
|
|
||||||
static inline bool gdm_tty_ready(struct gdm *gdm)
|
static inline bool gdm_tty_ready(struct gdm *gdm)
|
||||||
{
|
{
|
||||||
@ -152,9 +152,8 @@ static void gdm_tty_send_complete(void *arg)
|
|||||||
static ssize_t gdm_tty_write(struct tty_struct *tty, const u8 *buf, size_t len)
|
static ssize_t gdm_tty_write(struct tty_struct *tty, const u8 *buf, size_t len)
|
||||||
{
|
{
|
||||||
struct gdm *gdm = tty->driver_data;
|
struct gdm *gdm = tty->driver_data;
|
||||||
int remain = len;
|
size_t remain = len;
|
||||||
int sent_len = 0;
|
size_t sent_len = 0;
|
||||||
int sending_len = 0;
|
|
||||||
|
|
||||||
if (!gdm_tty_ready(gdm))
|
if (!gdm_tty_ready(gdm))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
@ -163,7 +162,7 @@ static ssize_t gdm_tty_write(struct tty_struct *tty, const u8 *buf, size_t len)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
sending_len = min(MUX_TX_MAX_SIZE, remain);
|
size_t sending_len = min(MUX_TX_MAX_SIZE, remain);
|
||||||
gdm->tty_dev->send_func(gdm->tty_dev->priv_dev,
|
gdm->tty_dev->send_func(gdm->tty_dev->priv_dev,
|
||||||
(void *)(buf + sent_len),
|
(void *)(buf + sent_len),
|
||||||
sending_len,
|
sending_len,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user