HI Dan,
On 02/07/24 10:23 pm, Dan Carpenter wrote:
On Tue, Jul 02, 2024 at 10:12:55PM +0530, Umang Jain wrote:
wait_event_interruptible() can return if the condition evaluates to
true or it receives a signal. However, the current code always assume
that the wait_event_interruptible() returns only when the event is
fired. This should not be the case as wait_event_interruptible() can
return on receiving a signal (with -ERESTARTSYS as return value).
I'm not sure I understand this paragraph.
In the original code remote_event_wait() returned true on success and
false if received a signal before succeeding. None of the callers
cared what it returned though.
We should consider this and bubble up the return value of
wait_event_interruptible() to exactly know if the wait has failed
and error out. This will also help to properly stop kthreads in the
subsequent patch.
Now it returns a negative error code or 1. Which is ugly. Make it
negative or zero.
I am fine with remote_event_wait() returning 0 for success, yes.
regards,
dan carpenter