Re: [PATCH v5 11/15] locking/lockdep: Check data structure consistency

From: Peter Zijlstra
Date: Thu Jan 10 2019 - 10:55:16 EST


On Mon, Dec 17, 2018 at 01:29:58PM -0800, Bart Van Assche wrote:
> + /* Check whether all classes occur in a lock list. */
> + for (i = 0; i < ARRAY_SIZE(lock_classes); i++) {
> + class = &lock_classes[i];
> + if (!in_list(&class->lock_entry, &all_lock_classes) &&
> + !in_list(&class->lock_entry, &free_lock_classes) &&
> + !in_any_zapped_class_list(class)) {
> + printk(KERN_INFO "class %px/%s is not in any class list\n",
> + class, class->name ? : "(?)");
> + return false;
> + return false;

I'm thinking just one return statement will suffice ;-)

> + }
> + }