summaryrefslogtreecommitdiff
path: root/src/northbridge
diff options
context:
space:
mode:
authorEdward O'Callaghan <eocallaghan@alterapraxis.com>2014-06-28 17:31:58 +1000
committerEdward O'Callaghan <eocallaghan@alterapraxis.com>2014-06-30 18:14:31 +0200
commitdf3629b63cc840f089cfd645fc5cf992bbbffe16 (patch)
treed8992866be74acd89e30463883743fc92d48b34f /src/northbridge
parent38a8fb0c1891bbe3b53965e04c1c7ebcc00654da (diff)
downloadcoreboot-df3629b63cc840f089cfd645fc5cf992bbbffe16.tar.xz
northbridge/amd/{gx2,lx}: Qualify pointer with `volatile`
There is no guarantee reading a dereferenced null pointer will not be optimised away. Qualify the integer storage type with volatile. Clang enforces this explicitness. Change-Id: I31524141d70632cade0490c820936a3a8b570346 Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/6148 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'src/northbridge')
-rw-r--r--src/northbridge/amd/gx2/northbridgeinit.c2
-rw-r--r--src/northbridge/amd/lx/northbridgeinit.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/northbridge/amd/gx2/northbridgeinit.c b/src/northbridge/amd/gx2/northbridgeinit.c
index 47611bfe0f..ef5277c50d 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 42b91d6d99..82b3f48e8e 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();