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;