diff mbox series

[v2,12/24] EDAC, ghes: Use standard kernel macros for page calculations

Message ID 20190624150758.6695-13-rrichter@marvell.com
State Superseded
Headers show
Series EDAC, mc, ghes: Fixes and updates to improve memory error reporting | expand

Commit Message

Robert Richter June 24, 2019, 3:09 p.m. UTC
Use standard macros for page calculations.

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

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

-- 
2.20.1

Comments

James Morse Aug. 2, 2019, 5:04 p.m. UTC | #1
Hi Robert,

On 24/06/2019 16:09, Robert Richter wrote:
> Use standard macros for page calculations.

> 

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

> ---


> diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c

> index 786f1b32eee1..746083876b5f 100644

> --- a/drivers/edac/ghes_edac.c

> +++ b/drivers/edac/ghes_edac.c

> @@ -311,8 +311,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 */

> 



After a shorter game of spot-the-difference:
Reviewed-by: James Morse <james.morse@arm.com>


Previously here:
https://lore.kernel.org/linux-edac/e566fe1d-ed06-53bc-6827-f6dfa32ee485@arm.com/


Please pick up tags when posting a new version.
If you don't do this, its very difficult to convince people to spend time reviewing your
series.


Thanks,

James
Robert Richter Aug. 7, 2019, 9:52 a.m. UTC | #2
On 02.08.19 18:04:54, James Morse wrote:
> After a shorter game of spot-the-difference:

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

> 

> Previously here:

> https://lore.kernel.org/linux-edac/e566fe1d-ed06-53bc-6827-f6dfa32ee485@arm.com/

> 

> 

> Please pick up tags when posting a new version.

> If you don't do this, its very difficult to convince people to spend time reviewing your

> series.


I already asked it in my other email, but I think you mean adding the
Reviewed-by: tag. Sorry for not adding it, I will do that in the

future.

-Robert
diff mbox series

Patch

diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c
index 786f1b32eee1..746083876b5f 100644
--- a/drivers/edac/ghes_edac.c
+++ b/drivers/edac/ghes_edac.c
@@ -311,8 +311,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 */