On Tue, 24 Jun 2014 08:15:55 +0200 (CEST) Peter Meerwald <[email protected]>
wrote:
> > > maybe the code could be #MACRO()'d to avoid duplication
> >
> > Do you mean to define int64_sqrt() directly as int_sqrt() on a 64 bit
> > platform where sizeof(long) == sizeof(long long)?
>
> something along the lines of
>
> #define INT_SQRT(name, type) \
> type name(type x) \
> type m, y = 0, b; \
> ...
>
> INT_SQRT(int_sqrt, unsigned long);
> INT_SQRT(int64_sqrt, unsigned long long);
>
> not sure if it is worth it
We have made smaller optimisations in the past ;)
But not a macro, please:
#ifdef CONFIG_64BIT
static inline unsigned long long int64_sqrt(unsigned long long x)
{
return int_sqrt(x);
}
#else
unsigned long long int64_sqrt(unsigned long long x);
#endif
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html