/* Set *choice to point to the default item's data, if any default item was set, and returns 1. If no default item was set, returns -ENOENT.  */
int menu_default_choice(struct menu *m, void **choice)
/* Set *choice to point to the default item's data, if any default item was set, and returns 1. If no default item was set, returns -ENOENT.  */
int menu_default_choice(struct menu *m, void **choice)
{
	if (m->default_item) {
		*choice = m->default_item->data;
		return 1;
	}
	return -ENOENT;
}