Re: [PATCH] tty/n_hdlc: fix sleep in !TASK_RUNNING state warning

From: Tetsuo Handa
Date: Thu Jan 03 2019 - 06:32:58 EST


On 2019/01/03 18:09, Jiri Slaby wrote:
> On 02. 01. 19, 16:04, Tetsuo Handa wrote:
>> + if (wait_event_interruptible(tty->read_wait,
>> + (ret = -EIO, test_bit(TTY_OTHER_CLOSED, &tty->flags)) ||
>> + (ret = 0, tty_hung_up_p(file)) ||
>> + (rbuf = n_hdlc_buf_get(&n_hdlc->rx_buf_list)) != NULL ||
>> + (ret = -EAGAIN, tty_io_nonblock(tty, file))))
>> + return -EINTR;
>
> Oh, that looks really ugly. Could you move all this to a function
> returning a bool and taking &ret and &rbuf as parameters?
>

OK. Something like this?