/* This is like of_node_to_nid_single() for memory represented in the ibm,dynamic-reconfiguration-memory node.  */
static int of_drconf_to_nid_single(struct of_drconf_cell *drmem, struct assoc_arrays *aa)
/* This is like of_node_to_nid_single() for memory represented in the ibm,dynamic-reconfiguration-memory node.  */
static int of_drconf_to_nid_single(struct of_drconf_cell *drmem, struct assoc_arrays *aa)
{
	int default_nid = 0;
	int nid = default_nid;
	int index;
	if (min_common_depth > 0 && min_common_depth <= aa->array_sz &&
	    !(drmem->flags & DRCONF_MEM_AI_INVALID) &&
	    drmem->aa_index < aa->n_arrays) {
		index = drmem->aa_index * aa->array_sz + min_common_depth - 1;
		nid = aa->arrays[index];
		if (nid == 0xffff || nid >= MAX_NUMNODES)
			nid = default_nid;
	}
	return nid;
}