cpumask emergency fixes pushed out

From: Linus Torvalds
Date: Mon Mar 06 2023 - 16:00:10 EST


Just a note to people involved in the multiple different threads that
I did a "quick fix" push of the verified fix for the random.c issue.

I still think that the lpfc driver in particular could be cleaned up,
and considering that the random.c use-case looks like it really wants
the same thing ("give me the next cpu, but wrap to the beginning if
that fails") I wonder if we should just have a generic helper for that
case.

The existing "cpumask_next_wrap()" function does do pretty much
exactly that, you just have to give it some unusual arguments. It *is*
used, but it's an odd enough interface that I'm not really sure that
I'm a huge fan of it.

Somewhat ironically, the native bitmap version
("find_next_bit_wrap()") does *not* have that ugly interface, and is
fairly straightforward. So it's really just the cpumask version that
has that extension that makes it so non-intuitive.

Anyway, I did that quick fix commit, but I do hope that people take a
look at those fixes for maybe doing things better. And if somebody
finds other not-quite-as obvious cases of that incorrect pattern of
checking a bit scanning function for 'nr_cpumask_bits', please holler.

Linus