Re: [PATCH v7 3/3] nl80211/mac80211: Report signal average

From: Peter Zijlstra
Date: Fri Nov 19 2010 - 07:17:29 EST


On Fri, 2010-11-19 at 18:07 +0900, Bruno Randolf wrote:

> Hmm, maybe I suck in mathemathics, but I don't see a way to do that given the
> formula:
>
> (((internal * (weight - 1)) + (val * factor)) / weight

If you assume weight == 2^n, you can write that as:

(((internal << n) - internal) + (val * factor)) >> n


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/