tty: use __unused annotation instead to silence warnings

This commit is contained in:
mmacy 2018-05-19 04:48:26 +00:00
parent ace81143fd
commit 214cb70c1a
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
ttyinq_write_nofrag(struct ttyinq *ti, const void *buf, size_t nbytes, int quote)
{
#ifdef INVARIANTS
size_t ret;
#endif
size_t ret __unused;
if (ttyinq_bytesleft(ti) < nbytes)
return (-1);
/* 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);
return (0);

View File

@ -324,15 +324,13 @@ ttyoutq_write(struct ttyoutq *to, const void *buf, size_t nbytes)
int
ttyoutq_write_nofrag(struct ttyoutq *to, const void *buf, size_t nbytes)
{
#ifdef INVARIANTS
size_t ret;
#endif
size_t ret __unused;
if (ttyoutq_bytesleft(to) < nbytes)
return (-1);
/* 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);
return (0);