/* Register the statistics pointed to by shdr, with the name of "name." */
int stats_register(const char *name, struct stats_hdr *hdr)
/* Register the statistics pointed to by shdr, with the name of "name." */
int stats_register(const char *name, struct stats_hdr *hdr)
{
	struct stats_hdr *prev;
	struct stats_hdr *cur;
	prev = NULL;
	for (cur = stats_list; cur != NULL; cur = cur->s_next) {
		if (strcmp(cur->s_name, name) == 0) {
			return -EALREADY;
		}
		prev = cur;
	}
	if (prev == NULL) {
		stats_list = hdr;
	} else {
		prev->s_next = hdr;
	}
	hdr->s_name = name;
	return 0;
}