mirror of
https://github.com/torvalds/linux.git
synced 2026-04-19 15:24:02 -04:00
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>
16 lines
479 B
C
16 lines
479 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
#ifndef SELFTEST_RISCV_HWPROBE_H
|
|
#define SELFTEST_RISCV_HWPROBE_H
|
|
#include <stddef.h>
|
|
#include <asm/hwprobe.h>
|
|
|
|
/*
|
|
* Rather than relying on having a new enough libc to define this, just do it
|
|
* ourselves. This way we don't need to be coupled to a new-enough libc to
|
|
* contain the call.
|
|
*/
|
|
long riscv_hwprobe(struct riscv_hwprobe *pairs, size_t pair_count,
|
|
size_t cpusetsize, unsigned long *cpus, unsigned int flags);
|
|
|
|
#endif
|