lkml.org 
[lkml]   [2014]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net-next v2 2/3] net: add trim helper and convert users
From
Date
On Fri, 2014-01-17 at 01:28 +0100, Hannes Frederic Sowa wrote:
[...]
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -193,6 +193,25 @@ extern int _cond_resched(void);
> (__x < 0) ? -__x : __x; \
> })
>
> +/**
> + * trim - perform a reciprocal multiplication in order to "clamp" a
> + * value into range [0, ep_ro), where the upper interval
> + * endpoint is right-open. This is useful, e.g. for accessing
> + * a index of an array containing ep_ro elements, for example.
> + * Think of it as sort of modulus, only that the result isn't
> + * that of modulo. ;)
> + * More: http://homepage.cs.uiowa.edu/~jones/bcd/divide.html
[...]

And you think trim() is an obvious name for that?!
How about: scale_u32_to_range().

Also the first physical line of a kernel-doc comment (after the name) is
a summary which is used, for example, in the summary line on a manual
page. It seems like you have the summary and full description the wrong
way round here.

Ben.

--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.



\
 
 \ /
  Last update: 2014-01-17 20:01    [W:1.419 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site