[v2,09/20] EDAC, ghes: Use standard kernel macros for page calculations

Message ID 20191106093239.25517-10-rrichter@marvell.com
State Accepted
Commit 7c1049317042a37638788bb8a892dbd75b742655
Headers show
Series
  • EDAC: Rework edac_mc and ghes drivers
Related show

Commit Message

Robert Richter Nov. 6, 2019, 9:33 a.m.
Use standard macros for page calculations.

Signed-off-by: Robert Richter <rrichter@marvell.com>

Reviewed-by: James Morse <james.morse@arm.com>

Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

---
 drivers/edac/ghes_edac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.20.1

Patch

diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c
index af27f8063891..944c9d2f0eef 100644
--- a/drivers/edac/ghes_edac.c
+++ b/drivers/edac/ghes_edac.c
@@ -319,8 +319,8 @@  void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err)
 
 	/* Error address */
 	if (mem_err->validation_bits & CPER_MEM_VALID_PA) {
-		e->page_frame_number = mem_err->physical_addr >> PAGE_SHIFT;
-		e->offset_in_page = mem_err->physical_addr & ~PAGE_MASK;
+		e->page_frame_number = PHYS_PFN(mem_err->physical_addr);
+		e->offset_in_page = offset_in_page(mem_err->physical_addr);
 	}
 
 	/* Error grain */