summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_ttydisc.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2008-09-02 17:13:11 +0000
committered <ed@FreeBSD.org>2008-09-02 17:13:11 +0000
commit84967086499f3a1a3480390747da9dcc1ae26abd (patch)
tree955654fcc97441db28af285079b0e626c3b80ee4 /sys/kern/tty_ttydisc.c
parent34b403920275f84339f0382d7d0b4a04f6d524f5 (diff)
downloadFreeBSD-src-84967086499f3a1a3480390747da9dcc1ae26abd.zip
FreeBSD-src-84967086499f3a1a3480390747da9dcc1ae26abd.tar.gz
Use size_t to store the return value of ttydisc_getc().
The ttydisc_getc() routine obtains a read length from ttyoutq_read(). For no valid reason, the current code stores this value in an int, and returns a size_t. There is no need to perform this useless conversion. Obtained from: //depot/projects/mpsafetty/...
Diffstat (limited to 'sys/kern/tty_ttydisc.c')
-rw-r--r--sys/kern/tty_ttydisc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/tty_ttydisc.c b/sys/kern/tty_ttydisc.c
index 6244166..1bcdfd6 100644
--- a/sys/kern/tty_ttydisc.c
+++ b/sys/kern/tty_ttydisc.c
@@ -1086,19 +1086,18 @@ ttydisc_wakeup_watermark(struct tty *tp)
size_t
ttydisc_getc(struct tty *tp, void *buf, size_t len)
{
- int ret;
tty_lock_assert(tp, MA_OWNED);
if (tp->t_flags & TF_STOPPED)
return (0);
- ret = ttyoutq_read(&tp->t_outq, buf, len);
+ len = ttyoutq_read(&tp->t_outq, buf, len);
ttydisc_wakeup_watermark(tp);
- atomic_add_long(&tty_nout, ret);
+ atomic_add_long(&tty_nout, len);
- return (ret);
+ return (len);
}
int
OpenPOWER on IntegriCloud