/* A lot of BIOS fill in 10 (= no distance) everywhere. This messes up the NUMA heuristics which wants the local node to have a smaller distance than the others. Do some quick checks here and only use the SLIT if it passes.  */
static __init int slit_valid(struct acpi_table_slit *slit)
/* A lot of BIOS fill in 10 (= no distance) everywhere. This messes up the NUMA heuristics which wants the local node to have a smaller distance than the others. Do some quick checks here and only use the SLIT if it passes.  */
static __init int slit_valid(struct acpi_table_slit *slit)
{
	int i, j;
	int d = slit->locality_count;
	for (i = 0; i < d; i++) {
		for (j = 0; j < d; j++)  {
			u8 val = slit->entry[d*i + j];
			if (i == j) {
				if (val != LOCAL_DISTANCE)
					return 0;
			} else if (val <= LOCAL_DISTANCE)
				return 0;
		}
	}
	return 1;
}