From 37298fadb66dee2c521f7ca00b790f873347dff2 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Fri, 31 Mar 2017 09:27:54 +0200 Subject: backports: copy average.h from original kernel Instead of maintaining our own version of average.h, just copy the upstream version while generating the backport. Signed-off-by: Johannes Berg --- backport/backport-include/linux/average.h | 46 ------------------------------- copy-list | 1 + 2 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 backport/backport-include/linux/average.h diff --git a/backport/backport-include/linux/average.h b/backport/backport-include/linux/average.h deleted file mode 100644 index 5d80041f..00000000 --- a/backport/backport-include/linux/average.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef __BACKPORT_AVERAGE -#define __BACKPORT_AVERAGE -#include_next - -#ifndef DECLARE_EWMA -#define DECLARE_EWMA(name, _factor, _weight) \ - struct ewma_##name { \ - unsigned long internal; \ - }; \ - static inline void ewma_##name##_init(struct ewma_##name *e) \ - { \ - BUILD_BUG_ON(!__builtin_constant_p(_factor)); \ - BUILD_BUG_ON(!__builtin_constant_p(_weight)); \ - BUILD_BUG_ON_NOT_POWER_OF_2(_factor); \ - BUILD_BUG_ON_NOT_POWER_OF_2(_weight); \ - e->internal = 0; \ - } \ - static inline unsigned long \ - ewma_##name##_read(struct ewma_##name *e) \ - { \ - BUILD_BUG_ON(!__builtin_constant_p(_factor)); \ - BUILD_BUG_ON(!__builtin_constant_p(_weight)); \ - BUILD_BUG_ON_NOT_POWER_OF_2(_factor); \ - BUILD_BUG_ON_NOT_POWER_OF_2(_weight); \ - return e->internal >> ilog2(_factor); \ - } \ - static inline void ewma_##name##_add(struct ewma_##name *e, \ - unsigned long val) \ - { \ - unsigned long internal = ACCESS_ONCE(e->internal); \ - unsigned long weight = ilog2(_weight); \ - unsigned long factor = ilog2(_factor); \ - \ - BUILD_BUG_ON(!__builtin_constant_p(_factor)); \ - BUILD_BUG_ON(!__builtin_constant_p(_weight)); \ - BUILD_BUG_ON_NOT_POWER_OF_2(_factor); \ - BUILD_BUG_ON_NOT_POWER_OF_2(_weight); \ - \ - ACCESS_ONCE(e->internal) = internal ? \ - (((internal << weight) - internal) + \ - (val << factor)) >> weight : \ - (val << factor); \ - } -#endif /* DECLARE_EWMA */ - -#endif /* __BACKPORT_AVERAGE */ diff --git a/copy-list b/copy-list index e0ff84b7..b284771e 100644 --- a/copy-list +++ b/copy-list @@ -18,6 +18,7 @@ include/linux/fixp-arith.h # This just defines some macros, simply take it include/linux/bitfield.h +include/linux/average.h # 802.11 drivers/net/wireless/Kconfig -- cgit v1.2.3