[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VdPhNbr6Y7ethsmw_Bd7DZOi4cyFHubPpOxa1LXibkUCQ@mail.gmail.com>
Date: Thu, 28 Oct 2021 13:25:48 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Andrea Merello <andrea.merello@...il.com>
Cc: Jonathan Cameron <jic23@...nel.org>,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
linux-iio <linux-iio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
devicetree <devicetree@...r.kernel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Rob Herring <robh+dt@...nel.org>,
Matt Ranostay <matt.ranostay@...sulko.com>,
Alexandru Ardelean <ardeleanalex@...il.com>,
jmondi <jacopo@...ndi.org>,
Andrea Merello <andrea.merello@....it>
Subject: Re: [v2 01/10] utils_macro: introduce find_closest_unsorted()
On Thu, Oct 28, 2021 at 1:18 PM Andrea Merello <andrea.merello@...il.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
Powered by blists - more mailing lists