All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Jiri Slaby <jirislaby@kernel.org>
Cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Vadim Fedorenko" <vadim.fedorenko@linux.dev>,
	"Richard Cochran" <richardcochran@gmail.com>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Joel Stanley" <joel@jms.id.au>,
	"Andrew Jeffery" <andrew@codeconstruct.com.au>,
	"Ryan Chen" <ryan_chen@aspeedtech.com>,
	"Billy Tsai" <billy_tsai@aspeedtech.com>,
	"Florian Fainelli" <florian.fainelli@broadcom.com>,
	"Broadcom internal kernel review list"
	<bcm-kernel-feedback-list@broadcom.com>,
	"Ray Jui" <ray.jui@broadcom.com>,
	"Scott Branden" <scott.branden@broadcom.com>,
	"Al Cooper" <alcooperx@gmail.com>,
	"Paul Cercueil" <paul@crapouillou.net>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Chaitanya Vadrevu" <chaitanya.vadrevu@emerson.com>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Helge Deller" <deller@gmx.de>,
	"Kumaravel Thiagarajan" <kumaravel.thiagarajan@microchip.com>,
	"Thierry Reding" <thierry.reding@kernel.org>,
	"Jonathan Hunter" <jonathanh@nvidia.com>,
	"Kunihiko Hayashi" <hayashi.kunihiko@socionext.com>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Kees Cook" <kees@kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	"Uwe Kleine-König (The Capable Hub)"
	<u.kleine-koenig@baylibre.com>,
	netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-aspeed@lists.ozlabs.org,
	linux-rpi-kernel@lists.infradead.org, linux-mips@vger.kernel.org,
	linux-mediatek@lists.infradead.org, linux-parisc@vger.kernel.org,
	linux-tegra@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH v2 6/6] serial: 8250: make port operations work on struct uart_8250_port
Date: Tue, 13 Oct 2026 12:09:18 +0300	[thread overview]
Message-ID: <as31PsESOgLUhMB6@ashevche-desk.local> (raw)
In-Reply-To: <c6b08f53-b5ee-44c8-93d1-54fdf5994ed2@kernel.org>

On Tue, Oct 13, 2026 at 09:53:26AM +0200, Jiri Slaby wrote:
> On 13. 10. 26, 9:33, Andy Shevchenko wrote:
> > On Tue, Oct 13, 2026 at 08:48:51AM +0200, Jiri Slaby (SUSE) wrote:

...

> > > -	rc = serial8250_register_8250_port(&port);
> > > -	if (rc < 0)
> > > +	struct uart_8250_port *uport = serial8250_register_8250_port(&port);
> > > +	if (IS_ERR(uport)) {
> > > +		rc = PTR_ERR(uport);
> > >   		goto err_sysfs_remove;
> > > +	}
> 
> > Also do not define
> > variables in the middle of the code (it's only allowed for auto cleanup
> > variables and for-loop iterators).
> 
> Why, actually?

Because it's the style. Linus also told it many times (I am tired to repeat
this, I leave it to you to find his words on lore.kernel.org).

> First, it is used in the kernel quite a few times already
> [1]. Second, while it is sort of c++ism (and I like to use modern c++), it
> makes the life of the variable a lot more obvious.
> 
> [1] eg. see output of: rg -U -C 5 '}\n+\s+struct .*\*.*=' drivers/

(you made me to install something I haven't heard about, it's better to use
 `git grep` though)

Note excluded __free() if I get regexp correctly

$ rg -U -l '}\n+\s+struct .*\*[^)]*=' drivers/ | less
drivers/ufs/host/ufs-qcom.c
drivers/dma/xilinx/xilinx_dma.c
drivers/dma/idxd/init.c
drivers/media/platform/raspberrypi/rp1-cfe/csi2.c
drivers/gpib/agilent_82357a/agilent_82357a.c
drivers/gpib/ni_usb/ni_usb_gpib.c
drivers/tty/serial/samsung_tty.c
drivers/s390/scsi/zfcp_scsi.c
drivers/gpio/gpiolib-shared.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
drivers/gpu/drm/msm/msm_gem_vma.c
drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

So, less than dozen of drivers doing wrong is not an argument, try something
better. But thanks, I will check and address this in some of the above.

-- 
With Best Regards,
Andy Shevchenko




  reply	other threads:[~2026-10-13  9:09 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13  6:48 [PATCH v2 0/6] serial: 8250: make port operations work on struct uart_8250_port Jiri Slaby (SUSE)
2026-10-13  6:48 ` [PATCH v2 1/6] serial: 8250: drop err label from serial8250_register_8250_port() Jiri Slaby (SUSE)
2026-10-14  6:49   ` sashiko-bot
2026-10-13  6:48 ` [PATCH v2 2/6] serial: 8250_exar: remove useless void * casts Jiri Slaby (SUSE)
2026-10-14  6:49   ` sashiko-bot
2026-10-13  6:48 ` [PATCH v2 3/6] serial: 8250_exar: store the GPIO platform device in struct exar8250 Jiri Slaby (SUSE)
2026-10-14  6:49   ` sashiko-bot
2026-10-13  6:48 ` [PATCH v2 4/6] serial: 8250_lpss: do not touch uninitialized line in ehl_serial_exit() Jiri Slaby (SUSE)
2026-10-13 21:13   ` Andy Shevchenko
2026-10-14  6:49   ` sashiko-bot
2026-10-13  6:48 ` [PATCH v2 5/6] serial: 8250_omap: set priv->line before enabling the IRQ Jiri Slaby (SUSE)
2026-10-14  6:49   ` sashiko-bot
2026-10-13  6:48 ` [PATCH v2 6/6] serial: 8250: make port operations work on struct uart_8250_port Jiri Slaby (SUSE)
2026-10-13  7:33   ` Andy Shevchenko
2026-10-13  7:53     ` Jiri Slaby
2026-10-13  9:09       ` Andy Shevchenko [this message]
2026-10-13  9:39         ` Jiri Slaby
2026-10-13 10:00           ` Andy Shevchenko
2026-10-13 10:15             ` Jiri Slaby
2026-10-13 10:54               ` Alejandro Colomar
2026-10-13 10:51           ` Alejandro Colomar
2026-10-13 11:06             ` Jiri Slaby
2026-10-13 13:42               ` Andy Shevchenko
2026-10-14  6:49   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=as31PsESOgLUhMB6@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=alcooperx@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@codeconstruct.com.au \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=billy_tsai@aspeedtech.com \
    --cc=chaitanya.vadrevu@emerson.com \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=edumazet@kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavoars@kernel.org \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=joel@jms.id.au \
    --cc=jonathanh@nvidia.com \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kumaravel.thiagarajan@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mhiramat@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=paul@crapouillou.net \
    --cc=ray.jui@broadcom.com \
    --cc=richardcochran@gmail.com \
    --cc=ryan_chen@aspeedtech.com \
    --cc=scott.branden@broadcom.com \
    --cc=thierry.reding@kernel.org \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=vadim.fedorenko@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.