Thread (30 messages) 30 messages, 8 authors, 2021-12-09

RE: [PATCH v1] gpudev: return EINVAL if invalid input pointer for free and unregister

From: Morten Brørup <hidden>
Date: 2021-12-02 12:34:03

From: Thomas Monjalon [mailto:thomas@monjalon.net]
Sent: Thursday, 2 December 2021 08.19

01/12/2021 22:37, Tyler Retzlaff:
quoted
On Wed, Nov 24, 2021 at 06:04:56PM +0000, Bruce Richardson wrote:
quoted
  if (ret < 0 && rte_errno == EAGAIN)
i only urge that this be explicit as opposed to a range i.e. ret == -
1
quoted
preferred over ret < 0
I don't understand why you think it is important to limit return value
to -1.
Why "if (ret == -1)" is better than "if (ret < 0)" ?
Speaking for myself:

For clarity. It leaves no doubt that "it failed" is represented by the return value -1, and that the function does not return errno values such as -EINVAL.

-Morten
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help