public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] common: introduce a genutils.h file
Date: Mon, 13 Dec 2010 10:26:33 +0100	[thread overview]
Message-ID: <1292232393-26481-1-git-send-email-hs@denx.de> (raw)
In-Reply-To: <1291903238-29071-1-git-send-email-hs@denx.de>

as discussed in thread
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/76654

and as a result of this discussion Michael Zaidman
proposed to create a genutils.h, see:

http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/78692

So, introduce this genutils.h, as BUILD_BUG_ON is also
needed in sensor support.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Michael Zaidman <michael.zaidman@gmail.com>
---
maybe I should include genutils.h in common.h ?

 include/genutils.h  |   30 ++++++++++++++++++++++++++++++
 include/ubi_uboot.h |    4 +---
 2 files changed, 31 insertions(+), 3 deletions(-)
 create mode 100644 include/genutils.h

diff --git a/include/genutils.h b/include/genutils.h
new file mode 100644
index 0000000..102f048
--- /dev/null
+++ b/include/genutils.h
@@ -0,0 +1,30 @@
+/*
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, hs at denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+
+#ifndef __GENUTILS_H_
+#define __GENUTILS_H_	1
+
+/* Force a compilation error if condition is true */
+#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
+
+#endif	/* __GENUTILS_H_ */
diff --git a/include/ubi_uboot.h b/include/ubi_uboot.h
index d2c90a6..ad15c8e 100644
--- a/include/ubi_uboot.h
+++ b/include/ubi_uboot.h
@@ -16,6 +16,7 @@
 
 #include <common.h>
 #include <compiler.h>
+#include <genutils.h>
 #include <malloc.h>
 #include <div64.h>
 #include <linux/crc32.h>
@@ -191,9 +192,6 @@ static inline long IS_ERR(const void *ptr)
 	return IS_ERR_VALUE((unsigned long)ptr);
 }
 
-/* Force a compilation error if condition is true */
-#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
-
 /* module */
 #define THIS_MODULE		0
 #define try_module_get(...)	1
-- 
1.7.2.3

  parent reply	other threads:[~2010-12-13  9:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09 14:00 [U-Boot] [PATCH][NEXT] hwmon: do not init sensors on startup Heiko Schocher
2010-12-09 14:26 ` Wolfgang Denk
2010-12-09 15:45   ` Heiko Schocher
2010-12-09 18:50     ` Wolfgang Denk
2010-12-13  9:26 ` Heiko Schocher [this message]
2011-01-09 16:46   ` [U-Boot] [PATCH 1/2] common: introduce a genutils.h file Wolfgang Denk
2011-01-10  7:09     ` Heiko Schocher
2011-01-10 10:19       ` Wolfgang Denk
2011-06-09  9:07   ` [U-Boot] [PATCH v3 1/2] common: move BUILD_BUG_ON define to common.h Heiko Schocher
2011-07-27 21:46     ` Wolfgang Denk
2010-12-13  9:26 ` [U-Boot] [PATCH 2/2 v2] hwmon: do not init sensors on startup Heiko Schocher
2011-01-09 16:49   ` Wolfgang Denk
2011-06-09  9:07   ` [U-Boot] [PATCH v3 2/2] " Heiko Schocher
2011-08-01  7:23     ` Holger Brunck
2011-08-01 10:13       ` Wolfgang Denk
2011-08-01 10:12     ` Wolfgang Denk
2011-08-01 11:08   ` [U-Boot] [PATCH v4 " Heiko Schocher
2011-08-01 13:28     ` Wolfgang Denk
2011-08-01 13:54       ` Heiko Schocher
2011-08-01 14:01   ` [U-Boot] [PATCH v5 " Heiko Schocher
2011-08-04 21:31     ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1292232393-26481-1-git-send-email-hs@denx.de \
    --to=hs@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox