[U-Boot] [PATCH 2/7] Add macros for recording init calls during UBoot execution

Mike Frysinger vapier at gentoo.org
Thu Sep 1 00:50:39 CEST 2011


On Wednesday, August 31, 2011 18:20:56 Andrew Murray wrote:
> +#if defined(CONFIG_BOOT_TRACE)
> +#define DO_INITCALL(x, ...) \
> +	do { \
> +		printf("calling  0x%pF\n", x); \
> +		(x)(__VA_ARGS__); \
> +		printf("initcall 0x%pF returned\n", x); \
> +	} while (0)

are there any void initcalls ?  or just ones where you ignore the value ?  
otherwise we can simply rename DO_INITCALL_RET() to DO_INITCALL().

> +#define DO_INITCALL_RET(x, ret, ...) \
> +	do { \
> +		printf("calling  0x%pF\n", x); \
> +		ret = (x)(__VA_ARGS__); \
> +		printf("initcall 0x%pF returned\n", x); \
> +	} while (0)

#define DO_INITCALL_RET(x, ...) \
	({ \
		int __ret; \
		printf("calling  0x%pF\n", x); \
		__ret = (x)(__VA_ARGS__); \
		printf("initcall 0x%pF returned\n", x); \
		__ret; \
	})
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110831/61532e77/attachment.pgp 


More information about the U-Boot mailing list