/* Return value: index into cmd_status / -EINVAL on failure  */
static int ibmvfc_get_err_index(u16 status, u16 error)
/* Return value: index into cmd_status / -EINVAL on failure  */
static int ibmvfc_get_err_index(u16 status, u16 error)
{
	int i;
	for (i = 0; i < ARRAY_SIZE(cmd_status); i++)
		if ((cmd_status[i].status & status) == cmd_status[i].status &&
		    cmd_status[i].error == error)
			return i;
	return -EINVAL;
}