On Fri, Aug 2, 2019 at 6:29 PM Andy Shevchenko <[email protected]> wrote: > > On Fri, Aug 2, 2019 at 1:19 PM Park, Aiden <[email protected]> wrote: > > > -----Original Message----- > > > From: Andy Shevchenko [mailto:[email protected]] > > > Sent: Friday, August 2, 2019 4:51 PM > > > To: Park, Aiden <[email protected]> > > > Cc: Bin Meng <[email protected]>; U-Boot Mailing List <u- > > > [email protected]>; Simon Glass <[email protected]> > > > Subject: Re: [PATCH v8 4/9] x86: slimbootloader: Add memory > > > configuration > > > On Fri, Aug 2, 2019 at 10:49 AM Andy Shevchenko > > > <[email protected]> wrote: > > > > On Fri, Aug 2, 2019 at 10:03 AM Park, Aiden <[email protected]> > > > wrote: > > > > > > +#define for_each_memory_map_entry_reversed(iter, entries) \ > > > > > + for (iter = entries->count - 1; iter >= 0; iter--) \ > > > > > + if (entries->entry[iter].type == E820_RAM) > > > > > + > > > > > > > > It seems you missed my answer to Bin. > > > > This is simple incorrect. Checkpatch sometimes is wrong. > > > > > > Let me elaborate why. > > > > > > The idea of having > > > > > > if (foo) {} else > > > > > > pattern is to avoid weirndess like > > > > > > for_each_...() { > > > ... > > > } else { > > > ...WTF!.. > > > } > > > > > Sorry for missing your comment. I understand '{} else' is better way. > > It looks checkpatch issue is bigger scope than this one. > > What about this in this series? > > > > #define for_each_if(condition) if (!(condition)) {} else > > #define for_each_memory_map_entry_reversed(iter, entries) \ > > for (iter = entries->count - 1; iter >= 0; iter--) \ > > for_each_if(entries->entry[iter].type == E820_RAM) > > > > tricky, but checkpatch does not report ERROR. > > Fine for me. If Bin is okay with it, it will be good then.
I am good too. Thanks for working on fixing checkpatch warnings! Regards, Bin _______________________________________________ U-Boot mailing list [email protected] https://lists.denx.de/listinfo/u-boot

