[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201011121044.40274.br1@einfach.org>
Date: Fri, 12 Nov 2010 10:44:40 +0900
From: Bruno Randolf <br1@...fach.org>
To: Stefan Richter <stefanr@...6.in-berlin.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>, randy.dunlap@...cle.com,
peterz@...radead.org, blp@...stanford.edu,
linux-kernel@...r.kernel.org, Lars_Ericsson@...ia.com,
kosaki.motohiro@...fujitsu.com, kevin.granade@...il.com,
"John W. Linville" <linville@...driver.com>
Subject: Re: [PATCH v6] Add generic exponentially weighted moving average (EWMA) function
On Fri November 12 2010 03:17:34 Stefan Richter wrote:
> It seems totally clear-cut to me that code like this is submitted together
> with at least one call site, and it is submitted through the tree in which
> that call site is maintained.
Ok. So I'll re-send the patch thru John's wireless tree after I fixed up your
comments.
> >> (And it's a bit sad that the function will exist in the base vmlinux
> >> even for people who don't ever use it, but that's a problem which we
> >> don't really have a good solution for).
> >
> > Hmm, should I switch it back to all inlines?
>
> Add a hidden Kconfig variable for it which is SELECTed by those Kconfig
> prompts that require it? That's the good solution that we use for a number
> of similar library functions.
> $ cat lib/Makefile
Ok.
> You use WARN_ON in lib/average.c. You should include <linux/bug.h>.
Thanks.
> 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));
Bruno
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists