diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-09-01 09:38:00 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-09-01 09:38:00 -0700 |
commit | 8e1e49550dc85694abd04d86a8ee36bc98bd8b9e (patch) | |
tree | 03133476605e455accd14770365ea05a3bce7007 /drivers/staging | |
parent | e925992671907314b7db6793a28eb39b36bc21a4 (diff) | |
parent | ebf05c7dc92c11b0355aaa0e94064beadaa4b05c (diff) | |
download | linux-stable-8e1e49550dc85694abd04d86a8ee36bc98bd8b9e.tar.gz linux-stable-8e1e49550dc85694abd04d86a8ee36bc98bd8b9e.tar.bz2 linux-stable-8e1e49550dc85694abd04d86a8ee36bc98bd8b9e.zip |
Merge tag 'tty-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial driver updates from Greg KH:
"Here is the big set of tty and serial driver changes for 6.6-rc1.
Lots of cleanups in here this cycle, and some driver updates. Short
summary is:
- Jiri's continued work to make the tty code and apis be a bit more
sane with regards to modern kernel coding style and types
- cpm_uart driver updates
- n_gsm updates and fixes
- meson driver updates
- sc16is7xx driver updates
- 8250 driver updates for different hardware types
- qcom-geni driver fixes
- tegra serial driver change
- stm32 driver updates
- synclink_gt driver cleanups
- tty structure size reduction
All of these have been in linux-next this week with no reported
issues. The last bit of cleanups from Jiri and the tty structure size
reduction came in last week, a bit late but as they were just style
changes and size reductions, I figured they should get into this merge
cycle so that others can work on top of them with no merge conflicts"
* tag 'tty-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (199 commits)
tty: shrink the size of struct tty_struct by 40 bytes
tty: n_tty: deduplicate copy code in n_tty_receive_buf_real_raw()
tty: n_tty: extract ECHO_OP processing to a separate function
tty: n_tty: unify counts to size_t
tty: n_tty: use u8 for chars and flags
tty: n_tty: simplify chars_in_buffer()
tty: n_tty: remove unsigned char casts from character constants
tty: n_tty: move newline handling to a separate function
tty: n_tty: move canon handling to a separate function
tty: n_tty: use MASK() for masking out size bits
tty: n_tty: make n_tty_data::num_overrun unsigned
tty: n_tty: use time_is_before_jiffies() in n_tty_receive_overrun()
tty: n_tty: use 'num' for writes' counts
tty: n_tty: use output character directly
tty: n_tty: make flow of n_tty_receive_buf_common() a bool
Revert "tty: serial: meson: Add a earlycon for the T7 SoC"
Documentation: devices.txt: Fix minors for ttyCPM*
Documentation: devices.txt: Remove ttySIOC*
Documentation: devices.txt: Remove ttyIOC*
serial: 8250_bcm7271: improve bcm7271 8250 port
...
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/gdm724x/gdm_tty.c | 17 | ||||
-rw-r--r-- | drivers/staging/greybus/uart.c | 3 |
2 files changed, 6 insertions, 14 deletions
diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c index e1a84d6020f4..32b2e817ff04 100644 --- a/drivers/staging/gdm724x/gdm_tty.c +++ b/drivers/staging/gdm724x/gdm_tty.c @@ -149,22 +149,17 @@ static void gdm_tty_send_complete(void *arg) tty_port_tty_wakeup(&gdm->port); } -static int gdm_tty_write(struct tty_struct *tty, const unsigned char *buf, - int len) +static ssize_t gdm_tty_write(struct tty_struct *tty, const u8 *buf, size_t len) { struct gdm *gdm = tty->driver_data; - int remain = len; - int sent_len = 0; - int sending_len = 0; + size_t remain = len; + size_t sent_len = 0; if (!gdm_tty_ready(gdm)) return -ENODEV; - if (!len) - return 0; - - while (1) { - sending_len = min(MUX_TX_MAX_SIZE, remain); + while (remain) { + size_t sending_len = min_t(size_t, MUX_TX_MAX_SIZE, remain); gdm->tty_dev->send_func(gdm->tty_dev->priv_dev, (void *)(buf + sent_len), sending_len, @@ -173,8 +168,6 @@ static int gdm_tty_write(struct tty_struct *tty, const unsigned char *buf, gdm); sent_len += sending_len; remain -= sending_len; - if (remain <= 0) - break; } return len; diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c index 20a34599859f..999ce613dca8 100644 --- a/drivers/staging/greybus/uart.c +++ b/drivers/staging/greybus/uart.c @@ -427,8 +427,7 @@ static void gb_tty_hangup(struct tty_struct *tty) tty_port_hangup(&gb_tty->port); } -static int gb_tty_write(struct tty_struct *tty, const unsigned char *buf, - int count) +static ssize_t gb_tty_write(struct tty_struct *tty, const u8 *buf, size_t count) { struct gb_tty *gb_tty = tty->driver_data; |