All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	<linux-ide@vger.kernel.org>, Jonathan Corbet <corbet@lwn.net>,
	<linux-doc@vger.kernel.org>
Subject: Re: [PATCH 2/5] ata: libata-core: Refactor force_tbl definition
Date: Sun, 24 Apr 2022 20:53:37 +0300	[thread overview]
Message-ID: <eefb2f6e-3f38-28bb-6e96-8eb42d27933b@omp.ru> (raw)
In-Reply-To: <20220407123748.1170212-3-damien.lemoal@opensource.wdc.com>

On 4/7/22 3:37 PM, Damien Le Moal wrote:

> Introduce the macro definitions force_cbl(), force_spd_limit(),
> force_xfer(), force_lflag_on(), force_horkage_on() and
> force_horkage_onoff() to define with a more compact syntax the struct
> ata_force_param entries in the force_tbl array defined in the function
> ata_parse_force_one().
> To reduce the indentation of the array declaration, force_tbl definition
> is also moved out of the ata_parse_force_one() function.

   Some entries are reordered too... :-)

> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index bc59c77b99b6..c0cf42ffcc38 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -6143,67 +6143,90 @@ int ata_platform_remove_one(struct platform_device *pdev)
>  EXPORT_SYMBOL_GPL(ata_platform_remove_one);
>  
>  #ifdef CONFIG_ATA_FORCE
> +
> +#define force_cbl(name, flag)				\
> +	{ # name,	.cbl		= (flag) }

   Why not #name here and below?

> +
> +#define force_spd_limit(spd, val)			\
> +	{ # spd,	.spd_limit	= (val) }
> +
> +#define force_xfer(mode, shift)				\
> +	{ # mode,	.xfer_mask	= (1UL << (shift)) }
> +
> +#define force_lflag_on(name, flags)			\

   Not just force_lflag()?

> +	{ # name,	.lflags		= (flags) }
> +
> +#define force_horkage_on(name, flag)			\
> +	{ # name,	.horkage_on	= (flag) }
> +
> +#define force_horkage_onoff(name, flag)			\
> +	{ "no" # name,	.horkage_on	= (flag) },	\
> +	{ # name,	.horkage_off	= (flag) }
> +
[...]
> @@ -6285,7 +6308,7 @@ static void __init ata_parse_force_param(void)
>  	int last_port = -1, last_device = -1;
>  	char *p, *cur, *next;
>  
> -	/* calculate maximum number of params and allocate force_tbl */
> +	/* Calculate maximum number of params and allocate ata_force_tbl */

   Drove-by change? :-)

[...]

Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>

MBR, Sergey

  reply	other threads:[~2022-04-24 17:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07 12:37 [PATCH 0/5] libata.force improvements Damien Le Moal
2022-04-07 12:37 ` [PATCH 1/5] ata: libata-core: cleanup ata_device_blacklist Damien Le Moal
2022-04-24 17:29   ` Sergey Shtylyov
2022-04-07 12:37 ` [PATCH 2/5] ata: libata-core: Refactor force_tbl definition Damien Le Moal
2022-04-24 17:53   ` Sergey Shtylyov [this message]
2022-04-25  1:34     ` Damien Le Moal
2022-04-07 12:37 ` [PATCH 3/5] ata: libata-core: Improve link flags forced settings Damien Le Moal
2022-04-24 18:01   ` Sergey Shtylyov
2022-04-07 12:37 ` [PATCH 4/5] ata: libata-core: Allow forcing most horkage flags Damien Le Moal
2022-04-24 18:17   ` Sergey Shtylyov
2022-04-25  1:15     ` Damien Le Moal
2022-04-07 12:37 ` [PATCH 5/5] doc: admin-guide: Update libata kernel parameters Damien Le Moal
2022-04-25 12:10   ` Sergey Shtylyov
2022-04-12  0:45 ` [PATCH 0/5] libata.force improvements Damien Le Moal
2022-04-17 18:10   ` Sergey Shtylyov

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=eefb2f6e-3f38-28bb-6e96-8eb42d27933b@omp.ru \
    --to=s.shtylyov@omp.ru \
    --cc=corbet@lwn.net \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=linux-doc@vger.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 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.