File tree Expand file tree Collapse file tree 1 file changed +7
-22
lines changed Expand file tree Collapse file tree 1 file changed +7
-22
lines changed Original file line number Diff line number Diff line change @@ -594,27 +594,6 @@ struct mem_ctl_info {
594
594
? (mci)->dimms[(dimm)->idx + 1] \
595
595
: NULL)
596
596
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
-
618
597
/**
619
598
* edac_get_dimm - Get DIMM info from a memory controller given by
620
599
* [layer0,layer1,layer2] position
@@ -650,6 +629,12 @@ static inline struct dimm_info *edac_get_dimm(struct mem_ctl_info *mci,
650
629
if (mci -> n_layers > 2 )
651
630
index = index * mci -> layers [2 ].size + layer2 ;
652
631
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 ];
654
639
}
655
640
#endif /* _LINUX_EDAC_H_ */
You can’t perform that action at this time.
0 commit comments