From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Sat, 17 Sep 2011 22:16:26 -0400 Subject: [U-Boot] [PATCH v2 2/7] Add macros for recording init calls during UBoot execution In-Reply-To: <1315660648-761-1-git-send-email-amurray@theiet.org> References: <1315658227-4388-2-git-send-email-amurray@theiet.org> <1315660648-761-1-git-send-email-amurray@theiet.org> Message-ID: <201109172216.27801.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Saturday, September 10, 2011 09:17:28 Andrew Murray wrote: > +#else > +#define DO_INITCALL(x, ...) \ > + ({ (x)(__VA_ARGS__); }) this should be do{}while(0) to avoid differences in behavior with the other DO_INITCALL() helper > +#define DO_INITCALL_END(x) \ > + do { \ > + printf_boot_trace("initcall 0x%pF returned\n", x); \ > + } while (0) > ... > +#define DO_INITCALL_END(x) seems like these should be merged so that dead code isnt caught in the middle #ifdef CONFIG_BOOT_TRACE # define _BOOT_TRACE 1 #else # define _BOOT_TRACE 0 #endif #define DO_INITCALL_END(x) \ do { \ if (_BOOT_TRACE) \ printf_boot_trace("initcall 0x%pF returned\n", x); \ } while (0) although, if printf_boot_trace() itself had CONFIG_BOOT_TRACE logic in it, you wouldnt have to have DO_INITCALL_END() take care of wrapping things ... -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/20110917/e18904fc/attachment.pgp