From 977852eb5777dfb63aaed94206e7364ac96e80f2 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 28 Nov 2008 10:16:39 +0000 Subject: [PATCH] qi-constrain-gta02-board-variants.patch Constrain board variants to legal numbers Signed-off-by: Andy Green --- qiboot/src/gta02/gta02.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qiboot/src/gta02/gta02.c b/qiboot/src/gta02/gta02.c index 5b569fe..c0d75d9 100644 --- a/qiboot/src/gta02/gta02.c +++ b/qiboot/src/gta02/gta02.c @@ -284,6 +284,8 @@ int gta02_get_pcb_revision(void) rGPDUP |= (1 << 0) | (1 << 3) | (1 << 4); rGPDDAT |= (1 << 0) | (1 << 3) | (1 << 4); + n &= 1; + return n; } @@ -316,7 +318,7 @@ int is_this_board_gta02(void) const struct board_variant const * get_board_variant_gta02(void) { - return &board_variants[gta02_get_pcb_revision()]; + return &board_variants[gta02_get_pcb_revision() & 1]; } static void putc_gta02(char c)