Messages in this thread | | | Date | Mon, 3 Jun 2013 12:57:14 +0300 | From | Dan Carpenter <> | Subject | Re: [PATCH V2 2/8] pktcdvd: Convert printk to pr_<level> |
| |
On Fri, May 31, 2013 at 09:11:23PM -0700, Joe Perches wrote: > +static const char *sense_key_string(__u8 index) > +{ > + static const char *info[9] = { > + "No sense", "Recovered error", "Not ready", > + "Medium error", "Hardware error", "Illegal request", > + "Unit attention", "Data protect", "Blank check" > + }; > + if (index < 8)
Off by one:
if (index < 9)
> + return info[index]; > + return "INVALID";
regards, dan carpenter
| |