lkml.org 
[lkml]   [2010]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6] Add generic exponentially weighted moving average (EWMA) function
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/


\
 
 \ /
  Last update: 2010-11-15 08:43    [W:0.095 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site