[PATCH 1/9] add-copyright-notices.patch

Andy Green andy at openmoko.com
Tue Aug 19 16:56:07 CEST 2008


Little notice cleanup + add ARRAY_SIZE

Signed-off-by: Andy Green <andy at openmoko.com>
---

 include/qi.h      |    2 ++
 src/gta02/gta02.c |   25 +++++++++++++++++++++++++
 src/start_qi.c    |    2 +-
 3 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/include/qi.h b/include/qi.h
index 16227a4..c4094d0 100644
--- a/include/qi.h
+++ b/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/src/gta02/gta02.c b/src/gta02/gta02.c
index 7566a9c..b74b727 100644
--- a/src/gta02/gta02.c
+++ b/src/gta02/gta02.c
@@ -1,3 +1,28 @@
+/*
+ * (C) Copyright 2007 OpenMoko, Inc.
+ * Author: Andy Green <andy at openmoko.com>
+ *
+ * (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 <qi.h>
 #include <neo_gta02.h>
 
diff --git a/src/start_qi.c b/src/start_qi.c
index de5abd4..1fe7df2 100644
--- a/src/start_qi.c
+++ b/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;
 




More information about the openmoko-kernel mailing list