soc/amd/picasso/mca: factor out mca_has_expected_bank_count
To factor out the rest of the common MCAX code, mca_bank_name[] may only be accessed by accessor functions, so implement this for the last place that still accessed mca_bank_name[] directly. Change-Id: Ic6548d3ceeb9c00ad344fc0bb3d97893e17a43a9 Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/56294 Reviewed-by: Martin Roth <martinroth@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
a83a58fe62
commit
64077de176
|
@ -33,6 +33,11 @@ static const char *const mca_bank_name[] = {
|
|||
[22] = "PIE",
|
||||
};
|
||||
|
||||
static bool mca_has_expected_bank_count(void)
|
||||
{
|
||||
return ARRAY_SIZE(mca_bank_name) == mca_get_bank_count();
|
||||
}
|
||||
|
||||
static bool mca_is_valid_bank(unsigned int bank)
|
||||
{
|
||||
return (bank < ARRAY_SIZE(mca_bank_name) && mca_bank_name[bank] != NULL);
|
||||
|
@ -70,7 +75,7 @@ void mca_check_all_banks(void)
|
|||
struct mca_bank_status mci;
|
||||
const unsigned int num_banks = mca_get_bank_count();
|
||||
|
||||
if (ARRAY_SIZE(mca_bank_name) != num_banks)
|
||||
if (!mca_has_expected_bank_count())
|
||||
printk(BIOS_WARNING, "CPU has an unexpected number of MCA banks!\n");
|
||||
|
||||
for (unsigned int i = 0 ; i < num_banks ; i++) {
|
||||
|
|
Loading…
Reference in New Issue