[coreboot-gerrit] New patch to review for coreboot: 96f13d6 northbridge/amd/{gx2, lx}: qualifying pointer with 'volatile'

Edward O'Callaghan (eocallaghan@alterapraxis.com) gerrit at coreboot.org
Sat Jun 28 09:36:25 CEST 2014


Edward O'Callaghan (eocallaghan at alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6148

-gerrit

commit 96f13d6839377b63684143150cdbb53aec969088
Author: Edward O'Callaghan <eocallaghan at alterapraxis.com>
Date:   Sat Jun 28 17:31:58 2014 +1000

    northbridge/amd/{gx2,lx}: qualifying pointer with 'volatile'
    
    There is no guarante reading a dereferenced null pointer will not be
    optimised away. Qualify the integer storage type with volatile. Clang
    enfoces this.
    
    Change-Id: I31524141d70632cade0490c820936a3a8b570346
    Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
---
 src/northbridge/amd/gx2/northbridgeinit.c | 2 +-
 src/northbridge/amd/lx/northbridgeinit.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/northbridge/amd/gx2/northbridgeinit.c b/src/northbridge/amd/gx2/northbridgeinit.c
index 47611bf..ef5277c 100644
--- a/src/northbridge/amd/gx2/northbridgeinit.c
+++ b/src/northbridge/amd/gx2/northbridgeinit.c
@@ -660,7 +660,7 @@ void northbridge_init_early(void)
 
 	/* Now that the descriptor to memory is set up. */
 	/* The memory controller needs one read to synch its lines before it can be used. */
-	i = *(int *) 0;
+	i = *(volatile int *) 0;
 
 	GeodeLinkPriority();
 
diff --git a/src/northbridge/amd/lx/northbridgeinit.c b/src/northbridge/amd/lx/northbridgeinit.c
index 42b91d6..82b3f48 100644
--- a/src/northbridge/amd/lx/northbridgeinit.c
+++ b/src/northbridge/amd/lx/northbridgeinit.c
@@ -742,7 +742,7 @@ void northbridge_init_early(void)
 
 	/*  Now that the descriptor to memory is set up. */
 	/*  The memory controller needs one read to synch its lines before it can be used. */
-	i = *(int *)0;
+	i = *(volatile int *)0;
 
 	GeodeLinkPriority();
 



More information about the coreboot-gerrit mailing list