diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2008-05-12 14:17:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-05-14 13:00:29 -0400 |
commit | 6def755320a214ae149ad6bc69eb8c1d7887e678 (patch) | |
tree | 11b454791e631d3e8f38b0ee6c811ab2bed2d7c8 /drivers/usb | |
parent | 5fc89390f74ac42165db477793fb30f6a200e79c (diff) |
usbtest: comment on why this code "expects" negative and positive errnos
On Mon, May 12, 2008 at 01:02:22AM -0700, David Brownell wrote:
> On Sunday 11 May 2008, Marcin Slusarz wrote:
> >
> > test_ctrl_queue expects (?) positive and negative errnos.
> > what is going on here?
>
> The sign is just a way to flag something:
>
> /* some faults are allowed, not required */
>
> The negative ones are required. Positive codes are optional,
> in the sense that, depending on how the peripheral happens
> to be implemented, they won't necessarily be triggered.
>
> For example, the test to fetch a device qualifier desriptor
> must succeed if the device is running at high speed. So that
> test is marked as negative. But when it's full speed, it
> could legitimately fail; marked as positive. And so on for
> other tests.
>
> Look at how the codes are *interpreted* to see it work.
Lets document it.
Based on comment from David Brownell <david-b@pacbell.net>.
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/misc/usbtest.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 742be3c35947..054dedd28127 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c | |||
@@ -856,6 +856,11 @@ test_ctrl_queue (struct usbtest_dev *dev, struct usbtest_param *param) | |||
856 | struct urb *u; | 856 | struct urb *u; |
857 | struct usb_ctrlrequest req; | 857 | struct usb_ctrlrequest req; |
858 | struct subcase *reqp; | 858 | struct subcase *reqp; |
859 | |||
860 | /* sign of this variable means: | ||
861 | * -: tested code must return this (negative) error code | ||
862 | * +: tested code may return this (negative too) error code | ||
863 | */ | ||
859 | int expected = 0; | 864 | int expected = 0; |
860 | 865 | ||
861 | /* requests here are mostly expected to succeed on any | 866 | /* requests here are mostly expected to succeed on any |