[libvirt] [PATCH] cleanup: clamp max info with MIN().

Daniel P. Berrange berrange at redhat.com
Tue May 20 09:40:53 UTC 2014


On Tue, May 20, 2014 at 11:28:02AM +0200, Martin Kletzander wrote:
> On Thu, May 15, 2014 at 08:03:09PM +0900, Dongsheng Yang wrote:
> >Rather than using a open coded implementation,
> >this patch use MIN macro to clamp infomation
> >to allowed maxmum.
> >
> 
> Sorry to say that, but I don't find it as readable as before.  At
> first, the idea with CLAMP was a nice improvement in case of both ends
> of the range being utilized, but I don't see any added value in this
> particular patch.
> 
> I was waiting if somebody expresses their opinion on this patch, but
> no response yet.  If there is particular need for this patch (or it
> helps with something I don't see), let me know, but if not then I'd
> leave it as is.  Mainly because some future patches will most likely
> not use MIN() and we would have another inconsistency in the code.

I tend to agree - I think it is easier to understand the code when
not using the macro here.


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list