Skip to content

Commit e370f88

Browse files
committed
EDAC: Remove edac_get_dimm_by_index()
It is unused now. Signed-off-by: Borislav Petkov <[email protected]>
1 parent b9cae27 commit e370f88

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

include/linux/edac.h

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -594,27 +594,6 @@ struct mem_ctl_info {
594594
? (mci)->dimms[(dimm)->idx + 1] \
595595
: NULL)
596596

597-
/**
598-
* edac_get_dimm_by_index - Get DIMM info at @index from a memory
599-
* controller
600-
*
601-
* @mci: MC descriptor struct mem_ctl_info
602-
* @index: index in the memory controller's DIMM array
603-
*
604-
* Returns a struct dimm_info * or NULL on failure.
605-
*/
606-
static inline struct dimm_info *
607-
edac_get_dimm_by_index(struct mem_ctl_info *mci, int index)
608-
{
609-
if (index < 0 || index >= mci->tot_dimms)
610-
return NULL;
611-
612-
if (WARN_ON_ONCE(mci->dimms[index]->idx != index))
613-
return NULL;
614-
615-
return mci->dimms[index];
616-
}
617-
618597
/**
619598
* edac_get_dimm - Get DIMM info from a memory controller given by
620599
* [layer0,layer1,layer2] position
@@ -650,6 +629,12 @@ static inline struct dimm_info *edac_get_dimm(struct mem_ctl_info *mci,
650629
if (mci->n_layers > 2)
651630
index = index * mci->layers[2].size + layer2;
652631

653-
return edac_get_dimm_by_index(mci, index);
632+
if (index < 0 || index >= mci->tot_dimms)
633+
return NULL;
634+
635+
if (WARN_ON_ONCE(mci->dimms[index]->idx != index))
636+
return NULL;
637+
638+
return mci->dimms[index];
654639
}
655640
#endif /* _LINUX_EDAC_H_ */

0 commit comments

Comments
 (0)