Messages in this thread | | | Date | Mon, 3 Jun 2013 13:42:06 +0300 | Subject | Re: [PATCH V2 2/8] pktcdvd: Convert printk to pr_<level> | From | Andy Shevchenko <> |
| |
On Mon, Jun 3, 2013 at 12:57 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote: > 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)
Perhaps if (index < ARRAY_SIZE(info)) ?
I actually didn't test this, if it returns number of strings.
-- With Best Regards, Andy Shevchenko
| |