Re: [PATCH 01/14] EDAC/amd64: Move struct fam_type variables into struct amd64_pvt

Borislav Petkov
2022-03-23T21:25:50Z

On Wed, Mar 23, 2022 at 05:19:26PM +0000, Yazen Ghannam wrote:
> I just noticed that families 15h and 16h aren't matching against a model
> range. I think we should look into that.

And while you're doing that, you could make those ranges a lot more
readable by using a second switch-case on the model. For example, with
F19h:

case 0x19:
switch (pvt->model) {
case 0x10 ... 0x1f:
fam_type = &family_types[F19_M10H_CPUS];
pvt->ops = &family_types[F19_M10H_CPUS].ops;
break;
case 0x20 ... 0x2f:
fam_type = &family_types[F17_M70H_CPUS];
pvt->ops = &family_types[F17_M70H_CPUS].ops;
fam_type->ctl_name = "F19h_M20h";
break;
case 0x50 ... 0x5f:
fam_type = &family_types[F19_M50H_CPUS];
pvt->ops = &family_types[F19_M50H_CPUS].ops;
fam_type->ctl_name = "F19h_M50h";
break;
case 0xa0 ... 0xaf:
fam_type = &family_types[F19_M10H_CPUS];
pvt->ops = &family_types[F19_M10H_CPUS].ops;
fam_type->ctl_name = "F19h_MA0h";
break;
default:
fam_type = &family_types[F19_CPUS];
pvt->ops = &family_types[F19_CPUS].ops;
family_types[F19_CPUS].ctl_name = "F19h";
break;
}
break;

--
Regards/Gruss,
Boris.