From: Niklas Cassel <cassel@kernel.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: linux-ide@vger.kernel.org
Subject: Re: [PATCH v5 1/4] ata: libata: Rename ata_dma_blacklisted()
Date: Thu, 25 Jul 2024 18:42:55 +0200 [thread overview]
Message-ID: <ZqKAj-wlHTLqCnjj@ryzen.lan> (raw)
In-Reply-To: <20240724054539.182655-2-dlemoal@kernel.org>
On Wed, Jul 24, 2024 at 02:45:36PM +0900, Damien Le Moal wrote:
> Rename the function ata_dma_blacklisted() to ata_dev_nodma() as this new
> name is more neutral. The function signature is also changed to return a
> boolean instead of an int.
>
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
> Reviewed-by: Igor Pylypiv <ipylypiv@google.com>
> ---
> drivers/ata/libata-core.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index c7752dc80028..a35bce4236d3 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -4287,16 +4287,17 @@ static unsigned long ata_dev_blacklisted(const struct ata_device *dev)
> return 0;
> }
>
> -static int ata_dma_blacklisted(const struct ata_device *dev)
> +static bool ata_dev_nodma(const struct ata_device *dev)
> {
> - /* We don't support polling DMA.
> - * DMA blacklist those ATAPI devices with CDB-intr (and use PIO)
> - * if the LLDD handles only interrupts in the HSM_ST_LAST state.
> + /*
> + * We do not support polling DMA. Deny DMA for those ATAPI devices
> + * with CDB-intr (and use PIO) if the LLDD handles only interrupts in
> + * the HSM_ST_LAST state.
> */
> if ((dev->link->ap->flags & ATA_FLAG_PIO_POLLING) &&
> (dev->flags & ATA_DFLAG_CDB_INTR))
> - return 1;
> - return (dev->horkage & ATA_HORKAGE_NODMA) ? 1 : 0;
> + return true;
> + return dev->horkage & ATA_HORKAGE_NODMA;
> }
>
> /**
> @@ -4404,7 +4405,7 @@ static void ata_dev_xfermask(struct ata_device *dev)
> xfer_mask &= ~(0x03 << (ATA_SHIFT_MWDMA + 3));
> }
>
> - if (ata_dma_blacklisted(dev)) {
> + if (ata_dev_nodma(dev)) {
> xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
> ata_dev_warn(dev,
> "device is on DMA blacklist, disabling DMA\n");
Nit: if you rename blacklist, perhaps you should rename/avoid it in the above
print as well.
Regardless:
Reviewed-by: Niklas Cassel <cassel@kernel.org>
next prev parent reply other threads:[~2024-07-25 16:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-24 5:45 [PATCH v5 0/4] Some cleanup, renaming and horkage improvements Damien Le Moal
2024-07-24 5:45 ` [PATCH v5 1/4] ata: libata: Rename ata_dma_blacklisted() Damien Le Moal
2024-07-25 16:42 ` Niklas Cassel [this message]
2024-07-24 5:45 ` [PATCH v5 2/4] ata: libata: Rename ata_dev_blacklisted() Damien Le Moal
2024-07-25 16:43 ` Niklas Cassel
2024-07-25 22:55 ` Damien Le Moal
2024-07-24 5:45 ` [PATCH v5 3/4] ata: libata: Change ata_dev_knobble() to return a bool Damien Le Moal
2024-07-24 17:34 ` Igor Pylypiv
2024-07-25 16:43 ` Niklas Cassel
2024-07-24 5:45 ` [PATCH v5 4/4] ata: libata: Print horkages applied to devices Damien Le Moal
2024-07-24 17:32 ` Igor Pylypiv
2024-07-25 16:45 ` Niklas Cassel
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=ZqKAj-wlHTLqCnjj@ryzen.lan \
--to=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).