History

EDAC: Introduce an mci_for_each_dimm() iterator

Introduce an mci_for_each_dimm() iterator. It returns a pointer to a struct dimm_info. This makes the declaration and use of an index obsolete and avoids access to internal data of struct mci (direct array access etc). [ bp: push the struct dimm_info *dimm; declaration into the CONFIG_EDAC_DEBUG block. ]

Robert Richter committed 7 years ago

Commit c498afa1 parent 977b1ce5 files · +40 −37Browse files

Showing the changes to include/linux (1 of 5 files). Show all

Unified · Split

include/linux/edac.h+7−0
@@ -599,6 +599,13 @@ struct mem_ctl_info { · 598 unmodified lines
599 u16 fake_inject_count;599 u16 fake_inject_count;
600};600};
601 601
602#define mci_for_each_dimm(mci, dimm) \
603 for ((dimm) = (mci)->dimms[0]; \
604 (dimm); \
605 (dimm) = (dimm)->idx + 1 < (mci)->tot_dimms \
606 ? (mci)->dimms[(dimm)->idx + 1] \
607 : NULL)
608
602/**609/**
603 * edac_get_dimm_by_index - Get DIMM info at @index from a memory610 * edac_get_dimm_by_index - Get DIMM info at @index from a memory
604 * controller611 * controller

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t