} else if (i >= nlkms) { *error = EINVAL; return NULL; } else for (p = TAILQ_FIRST(&lkmods); p != NULL && i--; p = TAILQ_NEXT(p, list)) ;
} else TAILQ_FOREACH(p, &lkmods, list) if (i == p->id) break;
lkmlookup(int i, char *name, int *error){	struct lkm_table *p = NULL;	char istr[MAXLKMNAME];	if (i < 0) {		/* unload by name */		/*		 * Copy name and lookup id from all loaded		 * modules.  May fail.		 */	 	*error = copyinstr(name, istr, MAXLKMNAME-1, NULL);		if (*error)			return NULL;		istr[MAXLKMNAME-1] = '\0';		TAILQ_FOREACH(p, &lkmods, list) {			if (!strcmp(istr, p->private.lkm_any->lkm_name))				break;		}	} else if (i >= nlkms) {		*error = EINVAL;		return NULL;	} else		for (p = TAILQ_FIRST(&lkmods); p != NULL && i--;		     p = TAILQ_NEXT(p, list))			;	if (p == NULL)		*error = ENOENT;	return p;}