On Tue, Aug 05, 2014 at 07:53:51PM -0600, Eric Blake wrote: > On 08/05/2014 08:02 AM, Michael S. Tsirkin wrote: > > On Fri, Aug 01, 2014 at 03:46:08PM +0800, arei.gong...@huawei.com wrote: > >> From: Gonglei <arei.gong...@huawei.com> > >> > >> $WHATEVER: don't use 'Yoda conditions' > >> > >> 'Yoda conditions' are not part of idiomatic QEMU coding > >> style, so rewrite them in the more usual order. > > > > > > OK but why stop at these files? How about this > > instead? > > > > > @ disable commeq @ > > expression E; > > constant C; > > @@ > > - C == E > > + E == C > > @ disable commeq @ > > expression E; > > constant C; > > @@ > > - C == E > > + E == C > > Why is this listed twice? > > > @ disable gtr_lss @ > > expression E; > > constant C; > > @@ > > - C > E > > + E < C > > This is wrong for floating point (think NaN); you'd have to audit the > results to make sure only integers are commuted.
I did, take a look at the results :) > > @ disable gtr_lss_eq @ > > expression E; > > constant C; > > @@ > > - C >= E > > + E <= C > > Ditto. > > > > > Signed-off-by: Michael S. Tsirkin <m...@redhat.com> > > The idea seems okay to me, but I haven't closely reviewed the patch yet. > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org >