Re: [GIT PULL] EDAC updates for v6.9

From: Randy Dunlap
Date: Mon Mar 11 2024 - 22:24:29 EST




On 3/11/24 18:12, Linus Torvalds wrote:
> On Mon, 11 Mar 2024 at 08:57, Borislav Petkov <bp@xxxxxxxxx> wrote:
>>
>> - return topology_die_id(err->cpu) % amd_get_nodes_per_socket();
>> + return topology_amd_node_id(err->cpu) % topology_amd_nodes_per_pkg();
>
> Ho humm. Lookie here:
>
> static inline unsigned int topology_amd_nodes_per_pkg(void)
> { return 0; };
>

and there's an extra/trailing ';'.

> that's the UP case.
>
> Yeah, I'm assuming nobody tests this for UP, but it's clearly wrong to
> potentially do that modulus by zero.
>
> So I made the merge also change that UP case of
> topology_amd_nodes_per_pkg() to return 1.
>
> Because dammit, not only is a mod-by-zero wrong, a UP system most
> definitely has one node per package, not zero.
>
> Linus
>

--
#Randy