[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC PATCH v3 02/18] xen: Add log2 functionality
>>> On 22.06.15 at 14:01, <vijay.kilari@xxxxxxxxx> wrote: First of all, please Cc _all_ relevant maintainers. > --- a/xen/include/xen/bitops.h > +++ b/xen/include/xen/bitops.h > @@ -117,6 +117,14 @@ static inline int generic_fls64(__u64 x) > # endif > #endif > > +static inline unsigned fls_long(unsigned long l) > +{ > + if (sizeof(l) == 4) > + return fls(l); > + > + return fls64(l); > +} I'm not really opposed to this, but did you really verify that there's no suitable functionality in tree already (even if named differently)? I can't, e.g., see why flsl() wouldn't fit your needs. > --- /dev/null > +++ b/xen/include/xen/log2.h > @@ -0,0 +1,205 @@ > +/* > + * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. > + * Written by David Howells (dhowells@xxxxxxxxxx) > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License > + * as published by the Free Software Foundation; either version > + * 2 of the License, or (at your option) any later version. > + */ > + > +#ifndef _LINUX_LOG2_H > +#define _LINUX_LOG2_H LINUX? > +/* > + * deal with unrepresentable constant logarithms > + */ > +extern __attribute__((const)) > +int ____ilog2_NaN(void); -ETOOMANYUNDERSCORES > +#if 1 ??? (at least one more below) Also, are you really needing all of what you add here? Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |