tty: use __unused annotation instead to silence warnings

This commit is contained in:
Matt Macy 2018-05-19 04:48:26 +00:00
parent b25651a46a
commit a2bb4e080e
2 changed files with 4 additions and 8 deletions

View File

@ -328,15 +328,13 @@ ttyinq_write(struct ttyinq *ti, const void *buf, size_t nbytes, int quote)
int int
ttyinq_write_nofrag(struct ttyinq *ti, const void *buf, size_t nbytes, int quote) ttyinq_write_nofrag(struct ttyinq *ti, const void *buf, size_t nbytes, int quote)
{ {
#ifdef INVARIANTS size_t ret __unused;
size_t ret;
#endif
if (ttyinq_bytesleft(ti) < nbytes) if (ttyinq_bytesleft(ti) < nbytes)
return (-1); return (-1);
/* We should always be able to write it back. */ /* We should always be able to write it back. */
DBGSET(ret, ttyinq_write(ti, buf, nbytes, quote)); ret = ttyinq_write(ti, buf, nbytes, quote);
MPASS(ret == nbytes); MPASS(ret == nbytes);
return (0); return (0);

View File

@ -324,15 +324,13 @@ ttyoutq_write(struct ttyoutq *to, const void *buf, size_t nbytes)
int int
ttyoutq_write_nofrag(struct ttyoutq *to, const void *buf, size_t nbytes) ttyoutq_write_nofrag(struct ttyoutq *to, const void *buf, size_t nbytes)
{ {
#ifdef INVARIANTS size_t ret __unused;
size_t ret;
#endif
if (ttyoutq_bytesleft(to) < nbytes) if (ttyoutq_bytesleft(to) < nbytes)
return (-1); return (-1);
/* We should always be able to write it back. */ /* We should always be able to write it back. */
DBGSET(ret, ttyoutq_write(to, buf, nbytes)); ret = ttyoutq_write(to, buf, nbytes);
MPASS(ret == nbytes); MPASS(ret == nbytes);
return (0); return (0);