Thread (9 messages) flat view 9 messages, 2 authors, 2007-12-10

Re: [PATCH 2/3] Use embedded libfdt in the bootwrapper

From: Scott Wood <hidden>
Date: 2007-12-10 17:32:17

On Mon, Dec 10, 2007 at 02:28:39PM +1100, David Gibson wrote:
+#define check_err(err) \
+	({ \
+		if (BAD_ERROR(err) || ((err < 0) && DEBUG)) \
+			printf("%s():%d  %s\n\r", __FUNCTION__, __LINE__, \
+			       fdt_strerror(err)); \
+		if (BAD_ERROR(err)) \
+			exit(); \
+		(err < 0) ? -1 : 0; \
+	})
+
+#define offset_devp(off)	\
+	({ \
+		int offset = (off); \
+		check_err(offset) ? NULL : (void *)(offset+1); \
+	})
+
+#define devp_offset(devp)	(((int)(devp))-1)
How does using offsets as devps work if a devp was previously acquired to a
node that has to be moved due to a change later made in an earlier part of
the tree?

-Scott
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help