Re: [PATCH] EDAC/amd64: remove unneeded call to reserve_mc_sibling_devs()
From: Yazen Ghannam
Date: Mon Feb 13 2023 - 15:13:00 EST
On Mon, Feb 13, 2023 at 11:15:10AM -0800, Tom Rix wrote:
> cpp_check reports
> drivers/edac/amd64_edac.c:3943:37: error: Uninitialized variable: pci_id1 [uninitvar]
> ret = reserve_mc_sibling_devs(pvt, pci_id1, pci_id2);
> ^
> drivers/edac/amd64_edac.c:3943:46: error: Uninitialized variable: pci_id2 [uninitvar]
> ret = reserve_mc_sibling_devs(pvt, pci_id1, pci_id2);
> ^
> The call to reserve_mc_sibling_devs() will not fail because
> if (pvt->umc)
> return 0;
>
> reserve_mc_sibling_devs() is only called by hw_info_get() and pvt->umc is only set
> in hw_info_get(), so with fam >= 0x17, the call to reserver_mc_siblings will
> just return, so the call the call is not needed. And when that call is moved
> the check for umc is not needed.
>
> Signed-off-by: Tom Rix <trix@xxxxxxxxxx>
> ---
Link to similar patch from Nathan:
https://lore.kernel.org/linux-edac/20230213-amd64_edac-wsometimes-uninitialized-v1-1-5bde32b89e02@xxxxxxxxxx/
Hi Tom and Nathan,
These errors are encountered when extra warnings are enabled, correct?
I think the following patch would resolve this issue. This is part of a set
that isn't fully applied.
https://lore.kernel.org/linux-edac/20230127170419.1824692-12-yazen.ghannam@xxxxxxx/
Boris,
Do you think one of these patches should be applied or just hold off until the
entire original set is applied?
As for myself, I'll start including builds with extra warnings enabled for
each patch in my workflow. Currently I do a regular build for each patch and a
build with extra warnings for the entire set.
Thanks,
Yazen