Edward O'Callaghan (eocallaghan@alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6148
-gerrit
commit 4ff9953d1f35e61d109ed5334fb4d42f0e2dc201 Author: Edward O'Callaghan eocallaghan@alterapraxis.com Date: Sat Jun 28 17:31:58 2014 +1000
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 --- 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();