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

Scott Wood scottwood at freescale.com
Tue Dec 11 04:32:17 EST 2007


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



More information about the Linuxppc-dev mailing list