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

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>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
c3e5c706 cfc7c12b

+5 -6
+5 -6
drivers/staging/gdm724x/gdm_tty.c
··· 17 17 #define GDM_TTY_MAJOR 0 18 18 #define GDM_TTY_MINOR 32 19 19 20 - #define WRITE_SIZE 2048 20 + #define WRITE_SIZE 2048UL 21 21 22 - #define MUX_TX_MAX_SIZE 2048 22 + #define MUX_TX_MAX_SIZE 2048UL 23 23 24 24 static inline bool gdm_tty_ready(struct gdm *gdm) 25 25 { ··· 152 152 static ssize_t gdm_tty_write(struct tty_struct *tty, const u8 *buf, size_t len) 153 153 { 154 154 struct gdm *gdm = tty->driver_data; 155 - int remain = len; 156 - int sent_len = 0; 157 - int sending_len = 0; 155 + size_t remain = len; 156 + size_t sent_len = 0; 158 157 159 158 if (!gdm_tty_ready(gdm)) 160 159 return -ENODEV; ··· 162 163 return 0; 163 164 164 165 while (1) { 165 - sending_len = min(MUX_TX_MAX_SIZE, remain); 166 + size_t sending_len = min(MUX_TX_MAX_SIZE, remain); 166 167 gdm->tty_dev->send_func(gdm->tty_dev->priv_dev, 167 168 (void *)(buf + sent_len), 168 169 sending_len,