[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5a1a5a80-526c-2f76-0086-15cc76e88a06@gmail.com>
Date: Mon, 15 Aug 2022 15:02:53 +0300
From: Matti Vaittinen <mazziesaccount@...il.com>
To: ChiaEn Wu <peterwu.pub@...il.com>, lee@...nel.org,
daniel.thompson@...aro.org, jingoohan1@...il.com, pavel@....cz,
robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org,
matthias.bgg@...il.com, sre@...nel.org, chunfeng.yun@...iatek.com,
gregkh@...uxfoundation.org, jic23@...nel.org, lars@...afoo.de,
linux@...ck-us.net, heikki.krogerus@...ux.intel.com, deller@....de,
broonie@...nel.org, lgirdwood@...il.com,
andriy.shevchenko@...ux.intel.com
Cc: chiaen_wu@...htek.com, alice_chen@...htek.com,
cy_huang@...htek.com, dri-devel@...ts.freedesktop.org,
linux-leds@...r.kernel.org, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org, linux-usb@...r.kernel.org,
linux-iio@...r.kernel.org, linux-fbdev@...r.kernel.org,
szunichen@...il.com
Subject: Re: [RESEND PATCH v8 06/12] lib: add linear range index macro
Hi ChiaEn,
On 8/15/22 12:01, ChiaEn Wu wrote:
> From: ChiaEn Wu <chiaen_wu@...htek.com>
>
> Add linear_range_idx macro for declaring the linear_range struct simply.
>
> Signed-off-by: ChiaEn Wu <chiaen_wu@...htek.com>
> ---
> include/linux/linear_range.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/linux/linear_range.h b/include/linux/linear_range.h
> index fd3d0b358f22..fb53ea13c593 100644
> --- a/include/linux/linear_range.h
> +++ b/include/linux/linear_range.h
> @@ -26,6 +26,14 @@ struct linear_range {
> unsigned int step;
> };
>
> +#define LINEAR_RANGE_IDX(_min, _min_sel, _max_sel, _step) \
> + { \
> + .min = _min, \
> + .min_sel = _min_sel, \
> + .max_sel = _max_sel, \
> + .step = _step, \
> + }
> +
I think this somewhat differs from what you had originally scetched. Eg,
if I didn't misread the patch earlier - you had:
#define MT6370_CHG_LINEAR_RANGE(_rfd, _min, _min_sel, _max_sel, _step) \
[_rfd] = { \
...
instead of the
> +#define LINEAR_RANGE_IDX(_min, _min_sel, _max_sel, _step) \
> + { \
I think the latter (without the []-index) is more generic, and very
welcome. However, the IDX-suffix does no longer make much sense, right?
I suggested name LINEAR_RANGE_IDX for macro taking the array index as it
would also be useful when dealing with arrays.
Do you think you could still drop the IDX from macro name or keep the
array index as the original did?
Maybe ideally introduce both macros (unless Mark has objections), one
with the [_rfd] and suffix IDX, and the other w/o the suffix and w/o the
[_rfd]?
Thanks for the improvements and the patience! ;)
Yours
-- Matti
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~
Powered by blists - more mailing lists