Re: [PATCH 31/33] serial: 8250: invert condition to avoid a goto label

From: Andy Shevchenko
Date: Wed Jun 18 2025 - 01:45:51 EST


On Wed, Jun 11, 2025 at 12:03:17PM +0200, Jiri Slaby (SUSE) wrote:
> Use of "goto" in this code is frowned upon:
> +-------
> |if (port->type == PORT_UNKNOWN)
> | goto out_unlock;
> |CODE;
> |out_unlock:
> +-------
>
> Instead, simply do:
> +-------
> |if (port->type != PORT_UNKNOWN)
> | CODE;
> +-------

Wouldn't this patch be a churn since you mentioned a guard()() conversion?
Basically with guard() in place the code would be better to change if it's
left as is.

--
With Best Regards,
Andy Shevchenko