On Sat, Sep 12, 2015 at 12:12 AM, Albert ARIBAUD <albert.u.b...@aribaud.net> wrote: > Hello Andrey, > > Two nitpicks: > >> +#if defined(CONFIG_ARM64) >> static noinline long smh_trap(unsigned int sysnum, void *addr) >> { >> register long result asm("r0"); >> -#if defined(CONFIG_ARM64) > > What's the point of moving the #ifdef up? It just forces you to > duplicate the function start with no discernable benefit since the > function name and arguments are the same in the 64 and 32 bit case. >
The point is to improve readability of the code. With #ifdef moved up you have to figure out the version of the code you care about first and then you can read the entirety of the function and reason about it. With #ifdefs inside of the body of the function, every time you read it you have to filter out all of the "irrelevant junk" that compiler would not even see on your platform. _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot