2024-02-21 18:48:35

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH v1 02/14] serial: core: Add UPIO_UNSET constant for unset port type

On 2/21/24 10:31, Andy Shevchenko wrote:
> In some APIs we would like to assign the special value to iotype
> and compare against it in another places. Introduce UPIO_UNSET
> for this purpose.
>
> Note, we can't use 0, because it's a valid value for IO port access.
>
> Signed-off-by: Andy Shevchenko <[email protected]>
> ---
> include/linux/serial_core.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> index 2d2ec99eca93..2b0526ae1fac 100644
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -470,6 +470,7 @@ struct uart_port {
>
> unsigned char iotype; /* io access style */
>
> +#define UPIO_UNSET ((unsigned char)~0U) /* UCHAR_MAX */

Nit: I would name this UPIO_UNKNOWN, or UPIO_NOTSET, unset means to me
that it was previously set and we undid that action, whereas unknown or
not set means we never did.
--
Florian



2024-02-21 18:53:35

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v1 02/14] serial: core: Add UPIO_UNSET constant for unset port type

On Wed, Feb 21, 2024 at 10:47:13AM -0800, Florian Fainelli wrote:
> On 2/21/24 10:31, Andy Shevchenko wrote:

..

> > unsigned char iotype; /* io access style */
> > +#define UPIO_UNSET ((unsigned char)~0U) /* UCHAR_MAX */
>
> Nit: I would name this UPIO_UNKNOWN, or UPIO_NOTSET, unset means to me that
> it was previously set and we undid that action, whereas unknown or not set
> means we never did.

Works for me. I will wait for a few days / week to have more reviews and
likely testings to be collected. Would be nice if you be able to test on
(some of) the hardware in the list of modified drivers.

--
With Best Regards,
Andy Shevchenko