Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932647Ab0KOHjp (ORCPT ); Mon, 15 Nov 2010 02:39:45 -0500 Received: from einhorn.in-berlin.de ([192.109.42.8]:51295 "EHLO einhorn.in-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757650Ab0KOHjl (ORCPT ); Mon, 15 Nov 2010 02:39:41 -0500 X-Envelope-From: stefanr@s5r6.in-berlin.de Date: Mon, 15 Nov 2010 08:38:39 +0100 From: Stefan Richter To: Bruno Randolf Cc: KOSAKI Motohiro , Andrew Morton , randy.dunlap@oracle.com, peterz@infradead.org, blp@cs.stanford.edu, linux-kernel@vger.kernel.org, Lars_Ericsson@telia.com, kevin.granade@gmail.com, "John W. Linville" Subject: Re: [PATCH v6] Add generic exponentially weighted moving average (EWMA) function Message-ID: <20101115083839.622b58af@stein> In-Reply-To: <201011151110.46007.br1@einfach.org> References: <4CDC333E.4070104@s5r6.in-berlin.de> <20101114133029.E008.A69D9226@jp.fujitsu.com> <4CDFA2FC.40603@s5r6.in-berlin.de> <201011151110.46007.br1@einfach.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1434 Lines: 32 On Nov 15 Bruno Randolf wrote: > On Sun November 14 2010 17:51:08 Stefan Richter wrote: > > BTW, isn't "get" more usually used as a prefix for these kinds of > > functions in kernel APIs? "get" as a suffix more often means "get > > a reference" alias increase reference count rather than "get the > > value". > > Umm. I don't know and honstly I don't care. I think the API ewma_* is > consistent. If you have a good reason to change it please let me > know, otherwise i'd just leave it like it is now. It is not about consistency of the API in itself but about consistency with the rest of the kernel. Cf. skb_get vs. get_unaligned and many more. I for one immediately think of "something is having its reference count incremented here" when I come across a something_get when reading code. I don't know of such a convention being documented anywhere. But for an overkill of examples of "get" as prefix and suffix, grep for get_ and _get( in include/. The same convention exists IME with "put" that either writes a value or drops a reference. Sorry for bringing this up so late but it is IMO not a trivial point. -- Stefan Richter -=====-==-=- =-== -==== http://arcgraph.de/sr/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/