/* To make lock name printouts unique, we calculate a unique class->name_version generation counter:  */
static int count_matching_names(struct lock_class *new_class)
/* To make lock name printouts unique, we calculate a unique class->name_version generation counter:  */
static int count_matching_names(struct lock_class *new_class)
{
	struct lock_class *class;
	int count = 0;
	if (!new_class->name)
		return 0;
	list_for_each_entry(class, &all_lock_classes, lock_entry) {
		if (new_class->key - new_class->subclass == class->key)
			return class->name_version;
		if (class->name && !strcmp(class->name, new_class->name))
			count = max(count, class->name_version);
	}
	return count + 1;
}