On Mon, Oct 29, 2012 at 11:51 AM, Laszlo Ersek <[email protected]> wrote: > On 10/26/12 19:35, Jordan Justen wrote: >> +#define RETURN_X_ON_ERROR(Status, X) \ >> + do { if (RETURN_ERROR (Status)) { return (X); } } while(0) >> + >> +#define RETURN_STATUS_ON_ERROR(Status) \ >> + do { RETURN_STATUS __MacroStatus = (Status); \ >> + if (RETURN_ERROR (__MacroStatus)) { return __MacroStatus; } \ >> + } while(0) > > I thought you objected to jump statements inside macros! ;)
Yes, true. :) But, I think you'll agree that in this case: 1. It is easy to see the macro may divert control flow 2. It is easy to see where control will divert to Yet, I think you are right, and I should not add these macros to this driver. I still wonder if they might be something to consider for MdePkg/Include/Base.h, since "if(EFI_ERROR) return Status" is something we do so often. > ... The LoadLinuxBzImage() function has no caller; I'd suggest dropping > it from here and its declaration from 2/4 (unless you have later plans > with it). Anyway dropping it can happen later. FWIW, I'm not reviewing > LoadLinuxBzImage() now. Ok, I'll remove this. (At one point I had a simple shell application that would use this function.) > TryRunningQemuKernel > LoadLinuxAllocateKernelSetupPages > LoadLinuxCheckKernelSetup > LoadLinuxGetKernelSize > LoadLinuxAllocateKernelPages > LoadLinuxAllocateCommandLinePages > LoadLinuxSetCommandLine > LoadLinuxAllocateInitrdPages > LoadLinuxSetInitrd > LoadLinux > BasicKernelSetupCheck > LoadLinuxCheckKernelSetup > InitLinuxDescriptorTables > SetupLinuxBootParams > SetupGraphics > SetupGraphicsFromGop > FindBits > SetupLinuxMemmap <---- I'm stuck here now, to be continued. > DisableInterrupts > SetLinuxDescriptorTables > JumpToKernel Thanks for the feedback thus far. -Jordan ------------------------------------------------------------------------------ The Windows 8 Center - In partnership with Sourceforge Your idea - your app - 30 days. Get started! http://windows8center.sourceforge.net/ what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/ _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
