Skip to content

Commit

Permalink
EDAC: Remove edac_get_dimm_by_index()
Browse files Browse the repository at this point in the history
It is unused now.

Signed-off-by: Borislav Petkov <bp@suse.de>
  • Loading branch information
Borislav Petkov committed Jun 16, 2020
1 parent b9cae27 commit e370f88
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions include/linux/edac.h
Original file line number Diff line number Diff line change
Expand Up @@ -594,27 +594,6 @@ struct mem_ctl_info {
? (mci)->dimms[(dimm)->idx + 1] \
: NULL)

/**
* edac_get_dimm_by_index - Get DIMM info at @index from a memory
* controller
*
* @mci: MC descriptor struct mem_ctl_info
* @index: index in the memory controller's DIMM array
*
* Returns a struct dimm_info * or NULL on failure.
*/
static inline struct dimm_info *
edac_get_dimm_by_index(struct mem_ctl_info *mci, int index)
{
if (index < 0 || index >= mci->tot_dimms)
return NULL;

if (WARN_ON_ONCE(mci->dimms[index]->idx != index))
return NULL;

return mci->dimms[index];
}

/**
* edac_get_dimm - Get DIMM info from a memory controller given by
* [layer0,layer1,layer2] position
Expand Down Expand Up @@ -650,6 +629,12 @@ static inline struct dimm_info *edac_get_dimm(struct mem_ctl_info *mci,
if (mci->n_layers > 2)
index = index * mci->layers[2].size + layer2;

return edac_get_dimm_by_index(mci, index);
if (index < 0 || index >= mci->tot_dimms)
return NULL;

if (WARN_ON_ONCE(mci->dimms[index]->idx != index))
return NULL;

return mci->dimms[index];
}
#endif /* _LINUX_EDAC_H_ */

0 comments on commit e370f88

Please sign in to comment.