public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [alsa-cvslog] CVS: alsa-kernel/usb usbaudio.c,1.172,1.173
       [not found] <E1FHG2j-0001sX-Ln@sc8-pr-cvs1.sourceforge.net>
@ 2006-03-09 21:49 ` Lee Revell
  2006-03-10  8:16   ` Clemens Ladisch
  0 siblings, 1 reply; 2+ messages in thread
From: Lee Revell @ 2006-03-09 21:49 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel, linux-kernel

On Wed, 2006-03-08 at 23:58 -0800, Clemens Ladisch wrote:
> +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:
> +	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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [alsa-cvslog] CVS: alsa-kernel/usb usbaudio.c,1.172,1.173
  2006-03-09 21:49 ` [alsa-cvslog] CVS: alsa-kernel/usb usbaudio.c,1.172,1.173 Lee Revell
@ 2006-03-10  8:16   ` Clemens Ladisch
  0 siblings, 0 replies; 2+ messages in thread
From: Clemens Ladisch @ 2006-03-10  8:16 UTC (permalink / raw)
  To: Lee Revell; +Cc: alsa-devel, linux-kernel, usb-devel

Lee Revell wrote:
> On Wed, 2006-03-08 at 23:58 -0800, Clemens Ladisch wrote:
> > +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:
> > +	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").

> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-03-10  8:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1FHG2j-0001sX-Ln@sc8-pr-cvs1.sourceforge.net>
2006-03-09 21:49 ` [alsa-cvslog] CVS: alsa-kernel/usb usbaudio.c,1.172,1.173 Lee Revell
2006-03-10  8:16   ` Clemens Ladisch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox