[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131025132615.GF5871@mwanda>
Date: Fri, 25 Oct 2013 16:26:16 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Dominik Paulus <dominik.paulus@....de>
Cc: Anthony Foiani <anthony.foiani@...il.com>,
devel@...verdev.osuosl.org, linux-kernel@...cs.fau.de,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Kurt Kanzenbach <ly80toro@....cs.fau.de>, tobias.polzer@....de,
linux-kernel@...r.kernel.org,
Ilija Hadzic <ihadzic@...earch.bell-labs.com>
Subject: Re: [PATCHv4 06/16] staging: usbip: Add proper error reporting
On Sat, Oct 19, 2013 at 04:39:09PM +0200, Dominik Paulus wrote:
> +const char *usbip_net_strerror(int status)
> +{
> + static const char *const errs[] = {
> + /* ERR_OK */ "Success",
> + /* ERR_NA */ "Command failed",
> + /* ERR_MISMATCH */ "Protocol version mismatch",
> + /* ERR_SYSERR */ "System error",
> + /* ERR_UNEXPECTED */ "Unexpected opcode received",
> + /* ERR_AUTHREQ */ "Server requires authentication",
> + /* ERR_PERM */ "Permission denied",
> + /* ERR_NOTFOUND */ "Requested device not found",
> + /* ERR_NOAUTH */ "Server doesn't support authentication"
> + };
> + if (status < 0)
> + status = -status;
> + if (status >= (int) (sizeof(errs) / sizeof(*errs)))
Not a big deal, but for future reference, the cast here is unneeded.
> + return "Invalid";
> + return errs[status];
> }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists