[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aFJSgfTrP0VTZ423@black.fi.intel.com>
Date: Wed, 18 Jun 2025 08:45:37 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: "Jiri Slaby (SUSE)" <jirislaby@...nel.org>
Cc: gregkh@...uxfoundation.org, linux-serial@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 31/33] serial: 8250: invert condition to avoid a goto
label
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
Powered by blists - more mailing lists