Re: [PATCH] sched_ext: fix application of sizeof to pointer

From: Markus Elfring
Date: Mon Nov 18 2024 - 12:33:37 EST


> sizeof when applied to a pointer typed expression gives the size of
> the pointer.
>
> The proper fix in this particular case is to code sizeof(cpu_set_t)
> instead of sizeof(cpuset).


I suggest to reconsider this view once more.

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.12#n941

Would the specification “sizeof(*cpuset)” be more appropriate here?

Regards,
Markus