*
* Initialize the EWMA parameters for a given struct ewma @avg.
*/
-void compat_ewma_init(struct ewma *avg, unsigned long factor, unsigned long weight)
+void ewma_init(struct ewma *avg, unsigned long factor, unsigned long weight)
{
WARN_ON(weight <= 1 || factor == 0);
avg->internal = 0;
avg->weight = weight;
avg->factor = factor;
}
-EXPORT_SYMBOL_GPL(compat_ewma_init);
+EXPORT_SYMBOL_GPL(ewma_init);
/**
* ewma_add() - Exponentially weighted moving average (EWMA)
*
* Add a sample to the average.
*/
-struct ewma *compat_ewma_add(struct ewma *avg, unsigned long val)
+struct ewma *ewma_add(struct ewma *avg, unsigned long val)
{
avg->internal = avg->internal ?
(((avg->internal * (avg->weight - 1)) +
(val * avg->factor);
return avg;
}
-EXPORT_SYMBOL_GPL(compat_ewma_add);
+EXPORT_SYMBOL_GPL(ewma_add);
unsigned long weight;
};
-/* mask ewma_init as RHEL6 backports this */
-#define ewma_init(a,b,c) compat_ewma_init(a,b,c)
-
+#define ewma_init LINUX_BACKPORT(ewma_init)
extern void ewma_init(struct ewma *avg, unsigned long factor,
unsigned long weight);
-/* mask ewma_add as RHEL6 backports this */
-#define ewma_add(a,b) compat_ewma_add(a,b)
-
+#define ewma_add LINUX_BACKPORT(ewma_add)
extern struct ewma *ewma_add(struct ewma *avg, unsigned long val);
+#define ewma_read LINUX_BACKPORT(ewma_read)
/**
* ewma_read() - Get average value
* @avg: Average structure