Thread (49 messages) 49 messages, 6 authors, 2020-12-02

Re: [PATCH v3 03/23] arm64: Make cpu_logical_map() take unsigned int

From: David Brazdil <hidden>
Date: 2020-12-02 15:45:22
Also in: kvmarm, linux-doc, lkml

On Thu, Nov 26, 2020 at 05:28:38PM +0000, Mark Rutland wrote:
On Thu, Nov 26, 2020 at 03:54:01PM +0000, David Brazdil wrote:
quoted
CPU index should never be negative. Change the signature of
(set_)cpu_logical_map to take an unsigned int.

Signed-off-by: David Brazdil <redacted>
Is there a function problem here, or is this just cleanup from
inspection?

Core code including the cpuhp_*() callbacks uses an int, so if there's a
strong justification to change this, it suggests there's some treewide
cleanup that should be done.

I don't have strong feelings on the matter, but I'd like to understand
the rationale.
Yeah, it's a mess. Marc and I felt that using a uint was less error-prone wrt
bounds checks. If this gets an int, it still works and only checking the upper
bound is required. Does that make sense?

David


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help