Re: [PATCH v6] Add generic exponentially weighted moving average (EWMA) function
From: KOSAKI Motohiro
Date: Sun Nov 14 2010 - 00:07:46 EST
> > Why do ewma_init() and ewma_add() return their first argument? They look
> > to me like they can be straight-forward void functions.
>
> You are right, for ewma_init() it does not make sense.
>
> For ewma_add() I think it does. This has been discussed before (e.g.
> http://linux.derkeiler.com/Mailing-Lists/Kernel/2010-10/msg09124.html).
> Some people might want to get the value when they add a sample by using
> ewma_get(ewma_add(&ewma, val));
ewma_add(&ewma, val);
ewma_get(&ewma);
is enough simpler and cleaner. I don't oppse this :)
--
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/