From d10aee81b0b7643146b4c22c9e5862c68faf63b3 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 28 Nov 2008 10:16:36 +0000 Subject: [PATCH] add-copyright-notices.patch Little notice cleanup + add ARRAY_SIZE Signed-off-by: Andy Green --- qiboot/include/qi.h | 2 ++ qiboot/src/gta02/gta02.c | 25 +++++++++++++++++++++++++ qiboot/src/start_qi.c | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/qiboot/include/qi.h b/qiboot/include/qi.h index 16227a4..c4094d0 100644 --- a/qiboot/include/qi.h +++ b/qiboot/include/qi.h @@ -30,6 +30,8 @@ #define u8 unsigned char typedef unsigned int uint32_t; +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) + enum filesystem { FS_RAW, FS_FAT, diff --git a/qiboot/src/gta02/gta02.c b/qiboot/src/gta02/gta02.c index 7566a9c..b74b727 100644 --- a/qiboot/src/gta02/gta02.c +++ b/qiboot/src/gta02/gta02.c @@ -1,3 +1,28 @@ +/* + * (C) Copyright 2007 OpenMoko, Inc. + * Author: Andy Green + * + * (port_init_gta02 came out of Openmoko U-Boot) + * + * Configuation settings for the OPENMOKO Neo GTA02 Linux GSM phone + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + */ + #include #include diff --git a/qiboot/src/start_qi.c b/qiboot/src/start_qi.c index de5abd4..1fe7df2 100644 --- a/qiboot/src/start_qi.c +++ b/qiboot/src/start_qi.c @@ -67,7 +67,7 @@ void start_qi(void) this_board = boards[board]; while (!n) { - if (board >= (sizeof(boards) / sizeof(boards[0]))) + if (board >= ARRAY_SIZE(boards)) /* can't put diagnostic on serial... too early */ goto unhappy;