Skip to contentSkip to conversation

CVS: alsa-kernel/usb usbaudio.c,1.172,1.173

alsa-cvslog Lee Revell 2 participants 2 messages Mar 9, 2006 – Mar 10, 2006 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Lee Revell

author
#1 lore raw
Quoted 14 lines · Clemens Ladisch
(quoted diff) +14 -0
+static const char *usb_error_string(int err)
+{
+	switch (err) {
+	case -ENODEV:
+		return "no device";
+	case -ENOENT:
+		return "endpoint not enabled";
+	case -EPIPE:
+		return "endpoint stalled";
+	case -ENOSPC:
+		return "not enough bandwidth";
+	case -ESHUTDOWN:
+		return "device disabled";
+	case -EHOSTUNREACH:

Review

Quoted 10 lines
(quoted diff) +10 -0
+		return "device suspended";
+	case -EINVAL:
+	case -EAGAIN:
+	case -EFBIG:
+	case -EMSGSIZE:
+		return "internal error";
+	default:
+		return "unknown error";
+	}
+}

Shouldn't a generic facility be created for this? After all these are standard error codes and it seem like other parts of the kernel might want to do user friendly error reporting.

Lee

#2 lore raw
Quoted 19 lines · Lee Revell
Quoted 18 lines · Clemens Ladisch
(quoted diff) +18 -0
+static const char *usb_error_string(int err)
+{
+	switch (err) {
+	case -ENODEV:
+		return "no device";
+	case -ENOENT:
+		return "endpoint not enabled";
+	case -EPIPE:
+		return "endpoint stalled";
+	case -ENOSPC:
+		return "not enough bandwidth";
+	case -ESHUTDOWN:
+		return "device disabled";
+	case -EHOSTUNREACH:
+		return "device suspended";
+	case -EINVAL:
+	case -EAGAIN:
+	case -EFBIG:
Quoted 8 lines

Review

Quoted 6 lines
(quoted diff) +6 -0
+	case -EMSGSIZE:
+		return "internal error";
+	default:
+		return "unknown error";
+	}
+}

Shouldn't a generic facility be created for this?

Yes, there's nothing audio specific in this function (except for my decision which codes to lump together as "internal error").

Quoted 2 lines

After all these are standard error codes and it seem like other parts of the kernel might want to do user friendly error reporting.

But it seems none of those parts actually does. ;-)

Clemens

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642