All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Niklas Cassel <cassel@kernel.org>
Cc: linux-ide@vger.kernel.org, xxjack12xx@gmail.com,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH v3 4/8] ata: libata: Add ata_force_get_fe_for_dev() helper
Date: Tue, 2 Dec 2025 11:28:38 +0900	[thread overview]
Message-ID: <2accc2a3-e88b-46f7-bcf7-b9f5cb631640@kernel.org> (raw)
In-Reply-To: <20251201123501.246282-14-cassel@kernel.org>

On 12/1/25 21:35, Niklas Cassel wrote:
> Add ata_force_get_fe_for_dev() helper to get the struct ata_force_ent for
> a struct ata_device.
> 
> Use the helper in ata_force_quirks().
> The helper will also be used in follow up commits.
> 
> No functional change intended.
> 
> Signed-off-by: Niklas Cassel <cassel@kernel.org>
> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

A few nits below. With these addressed, feel free to add:

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

> -/**
> - *	ata_force_quirks - force quirks according to libata.force
> - *	@dev: ATA device of interest
> - *
> - *	Force quirks according to libata.force and whine about it.
> - *	For consistency with link selection, device number 15 selects
> - *	the first device connected to the host link.
> - *
> - *	LOCKING:
> - *	EH context.
> - */
> -static void ata_force_quirks(struct ata_device *dev)
> +static const struct ata_force_ent
> +*ata_force_get_fe_for_dev(struct ata_device *dev)

The "*" should be on the previous line as it is part of the type definition for
the return value.

>  {
>  	int devno = dev->link->pmp + dev->devno;
>  	int alt_devno = devno;
>  	int i;
> +	const struct ata_force_ent *fe;

Nit: move this as the first declaration so that there is not a long declaration
line after a short one. Yes, this is 100% visual only, not a bug :)

>  
>  	/* allow n.15/16 for devices attached to host port */
>  	if (ata_is_host_link(dev->link))
>  		alt_devno += 15;
>  
>  	for (i = 0; i < ata_force_tbl_size; i++) {
> -		const struct ata_force_ent *fe = &ata_force_tbl[i];
> +		fe = &ata_force_tbl[i];
>  

Maybe drop the blank line here ?

>  		if (fe->port != -1 && fe->port != dev->link->ap->print_id)
>  			continue;



-- 
Damien Le Moal
Western Digital Research

  reply	other threads:[~2025-12-02  2:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 12:35 [PATCH v3 0/8] ata: libata: Quirk DELLBOSS VD max_sectors Niklas Cassel
2025-12-01 12:35 ` [PATCH v3 1/8] ata: libata: Move quirk flags to their own enum Niklas Cassel
2025-12-01 12:35 ` [PATCH v3 2/8] ata: libata-core: Quirk DELLBOSS VD max_sectors Niklas Cassel
2025-12-02  2:20   ` Damien Le Moal
2025-12-01 12:35 ` [PATCH v3 3/8] ata: libata: Add ATA_QUIRK_MAX_SEC and convert all device quirks Niklas Cassel
2025-12-02  2:23   ` Damien Le Moal
2025-12-01 12:35 ` [PATCH v3 4/8] ata: libata: Add ata_force_get_fe_for_dev() helper Niklas Cassel
2025-12-02  2:28   ` Damien Le Moal [this message]
2025-12-01 12:35 ` [PATCH v3 5/8] ata: libata: Change libata.force to use the generic ATA_QUIRK_MAX_SEC quirk Niklas Cassel
2025-12-02  2:30   ` Damien Le Moal
2025-12-01 12:35 ` [PATCH v3 6/8] ata: libata: Add support to parse equal sign in libata.force Niklas Cassel
2025-12-02  2:33   ` Damien Le Moal
2025-12-01 12:35 ` [PATCH v3 7/8] ata: libata: Add libata.force parameter max_sec Niklas Cassel
2025-12-02  2:37   ` Damien Le Moal
2025-12-01 12:35 ` [PATCH v3 8/8] ata: libata: Allow more quirks Niklas Cassel
2025-12-02  2:42   ` Damien Le Moal
2025-12-02 10:21 ` (subset) [PATCH v3 0/8] ata: libata: Quirk DELLBOSS VD max_sectors 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=2accc2a3-e88b-46f7-bcf7-b9f5cb631640@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=cassel@kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=xxjack12xx@gmail.com \
    /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.