RISC-V: hwprobe: Clarify cpus size parameter
authorAndrew Jones <ajones@ventanamicro.com>
Wed, 22 Nov 2023 16:47:02 +0000 (17:47 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 3 Jan 2024 11:36:47 +0000 (03:36 -0800)
commit36d842d654beba970e74ff0f6016c93623b82d37
treeb3e0f1a94f0ca29f7e83049b9e7bc3e14430824d
parentb85ea95d086471afb4ad062012a4d73cd328fa86
RISC-V: hwprobe: Clarify cpus size parameter

The "count" parameter associated with the 'cpus' parameter of the
hwprobe syscall is the size in bytes of 'cpus'. Naming it 'cpu_count'
may mislead users (it did me) to think it's the number of CPUs that
are or can be represented by 'cpus' instead. This is particularly
easy (IMO) to get wrong since 'cpus' is documented to be defined by
CPU_SET(3) and CPU_SET(3) also documents a CPU_COUNT() (the number
of CPUs in set) macro. CPU_SET(3) refers to the size of cpu sets
with 'setsize'. Adopt 'cpusetsize' for the hwprobe parameter and
specifically state it is in bytes in Documentation/riscv/hwprobe.rst
to clarify.

Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20231122164700.127954-7-ajones@ventanamicro.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Documentation/arch/riscv/hwprobe.rst
arch/riscv/kernel/sys_riscv.c
arch/riscv/kernel/vdso/hwprobe.c
tools/testing/selftests/riscv/hwprobe/hwprobe.c
tools/testing/selftests/riscv/hwprobe/hwprobe.h
tools/testing/selftests/riscv/vector/vstate_prctl.c