Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a5dfc31 authored by Borislav Petkov's avatar Borislav Petkov Committed by Borislav Petkov
Browse files

amd64_edac: Use DBAM_DIMM macro



Instead of open-coding it, use the DBAM_DIMM macro in
amd64_csrow_nr_pages() which we have already.

Signed-off-by: default avatarBorislav Petkov <borislav.petkov@amd.com>
parent bb89f5a0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2094,7 +2094,7 @@ static u32 amd64_csrow_nr_pages(struct amd64_pvt *pvt, u8 dct, int csrow_nr)
	 * number of bits to shift the DBAM register to extract the proper CSROW
	 * field.
	 */
	cs_mode =  (dbam >> ((csrow_nr / 2) * 4)) & 0xF;
	cs_mode = DBAM_DIMM(csrow_nr / 2, dbam);

	nr_pages = pvt->ops->dbam_to_cs(pvt, dct, cs_mode) << (20 - PAGE_SHIFT);

+1 −1
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@
#define DBAM1				0x180

/* Extract the DIMM 'type' on the i'th DIMM from the DBAM reg value passed */
#define DBAM_DIMM(i, reg)		((((reg) >> (4*i))) & 0xF)
#define DBAM_DIMM(i, reg)		((((reg) >> (4*(i)))) & 0xF)

#define DBAM_MAX_VALUE			11