lkml.org 
[lkml]   [2021]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [v2 01/10] utils_macro: introduce find_closest_unsorted()
On Thu, Oct 28, 2021 at 1:18 PM Andrea Merello <andrea.merello@gmail.com> wrote:
>
> This is similar to find_closest() and find_closest_descending(), but, it
> doesn't make any assumption about the array being ordered.

Macros in general are not so welcoming.
Why do you do it as a macro?

...

> +#include <linux/math.h>

Wondering if the current header misses other inclusions it's a direct user of.

...

> +/**
> + * find_closest_unsorted - locate the closest element in a unsorted array

an

> + * @x: The reference value.
> + * @a: The array in which to look for the closest element.
> + * @as: Size of 'a'.
> + *
> + * Similar to find_closest() but 'a' has no requirement to being sorted
> + */

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2021-10-28 12:27    [W:0.766 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site