Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751918AbWCIVtt (ORCPT ); Thu, 9 Mar 2006 16:49:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751923AbWCIVtt (ORCPT ); Thu, 9 Mar 2006 16:49:49 -0500 Received: from viper.oldcity.dca.net ([216.158.38.4]:16278 "HELO viper.oldcity.dca.net") by vger.kernel.org with SMTP id S1751918AbWCIVtt (ORCPT ); Thu, 9 Mar 2006 16:49:49 -0500 Subject: Re: [alsa-cvslog] CVS: alsa-kernel/usb usbaudio.c,1.172,1.173 From: Lee Revell To: Clemens Ladisch Cc: alsa-devel , linux-kernel In-Reply-To: References: Content-Type: text/plain Date: Thu, 09 Mar 2006 16:49:46 -0500 Message-Id: <1141940987.13319.71.camel@mindpipe> Mime-Version: 1.0 X-Mailer: Evolution 2.5.92 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1028 Lines: 37 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/