Re:Re: [PATCH] sched/rt.c: use list_is_singular() instead of '->prev != ->next'

From: 苏辉
Date: Mon Oct 26 2020 - 23:41:23 EST


>Perhaps there should be a list_has_more_than_one() API, as list_is_singular
>requires two checks, and the "more_than_one" only requires a single check.
>
>list_is_singular() is:
>
> return !list_empty(list) && (list->next == list->prev);
>
>
>which is more work than what you are replacing.
>

Hi, Steve:

Thanks for your explanation.
Maybe we should add another api called "list_more_than_one" just without
list_empty() check.

I will send PATCH V2 later.

Thank.