Re: [PATCH 1/2] staging: vchiq_core: Bubble up wait_event_interruptible() return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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






[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux