public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Jiri Slaby <jirislaby@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH v1 1/1] serial: 8250_port: Drop duplicate NULL check
Date: Tue, 3 Mar 2026 10:26:09 +0200	[thread overview]
Message-ID: <aaabITX34OyXB2Dg@ashevche-desk.local> (raw)
In-Reply-To: <aaaT_LiDbWX-ifK1@ashevche-desk.local>

On Tue, Mar 03, 2026 at 09:55:45AM +0200, Andy Shevchenko wrote:
> On Tue, Mar 03, 2026 at 06:25:29AM +0100, Jiri Slaby wrote:
> > On 02. 03. 26, 16:27, Andy Shevchenko wrote:
> > > serial8250_release_dma() is NULL-aware, no need to check this in the caller.
> > > While at it, make sure DMA won't be used again, by NULLifying the pointer.

...

> > > -	if (up->dma)
> > > -		serial8250_release_dma(up);
> > > +	serial8250_release_dma(up);
> > > +	up->dma = NULL;
> > 
> > Shouldn't serial8250_release_dma() NULL it instead, so the callers need not
> > to bother?
> 
> I copied what 8250_omap is doing. But we can do what you suggested I think.

I looked at the 8250_dma code and serial8250_release_dma() in particular,
and I think I am not going to change the approach. The 'dma' pointer is
assigned outside of serial8250_request_dma() and NULLifying it in
serial8250_release_dma() will be a layering violation.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-03-03  8:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02 15:27 [PATCH v1 1/1] serial: 8250_port: Drop duplicate NULL check Andy Shevchenko
2026-03-03  5:25 ` Jiri Slaby
2026-03-03  7:55   ` Andy Shevchenko
2026-03-03  8:26     ` Andy Shevchenko [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-01-28 14:27 Andy Shevchenko
2026-01-28 15:09 ` Ilpo Järvinen
2026-01-28 15:44   ` Andy Shevchenko

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=aaabITX34OyXB2Dg@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox