Jacob Garber has uploaded this change for review.

View Change

mb/google/link: Make iodefs array const

This array is fixed during compile time and is not modified during
program execution, so we can make it const.

Change-Id: I3b4a71e1763b6d7e09859691f3a8d829f5f04577
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
---
M src/mainboard/google/link/i915.c
M src/mainboard/google/link/i915io.c
2 files changed, 5 insertions(+), 5 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/33157/1
diff --git a/src/mainboard/google/link/i915.c b/src/mainboard/google/link/i915.c
index 12d424c..955ae4f 100644
--- a/src/mainboard/google/link/i915.c
+++ b/src/mainboard/google/link/i915.c
@@ -132,8 +132,8 @@
return microseconds(globalstart, rdtscll());
}

-extern struct iodef iodefs[];
-extern int niodefs;
+extern const struct iodef iodefs[];
+extern const int niodefs;

static int i915_init_done = 0;

@@ -154,7 +154,7 @@
static int run(int index)
{
int i, prev = 0;
- struct iodef *id, *lastidread = NULL;
+ const struct iodef *id, *lastidread = NULL;
unsigned long u, t;
if (index >= niodefs)
return index;
diff --git a/src/mainboard/google/link/i915io.c b/src/mainboard/google/link/i915io.c
index 5ebb42d..dea78d0 100644
--- a/src/mainboard/google/link/i915io.c
+++ b/src/mainboard/google/link/i915io.c
@@ -17,7 +17,7 @@
#include <stdlib.h>
#include "i915io.h"

-struct iodef iodefs[] = {
+const struct iodef iodefs[] = {
{V, 0},
{W, 1, "", PCH_GMBUS0, 0x00000000, 0},
{R, 1, "", PP_ON_DELAYS, ( /* T2 */ 0x0 << 16) | ( /* T5 */ 0x0 << 0) | 0x00000000, 0},
@@ -352,4 +352,4 @@
{I,},
};

-int niodefs = ARRAY_SIZE(iodefs);
+const int niodefs = ARRAY_SIZE(iodefs);

To view, visit change 33157. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3b4a71e1763b6d7e09859691f3a8d829f5f04577
Gerrit-Change-Number: 33157
Gerrit-PatchSet: 1
Gerrit-Owner: Jacob Garber <jgarber1@ualberta.ca>
Gerrit-MessageType: newchange