All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	linux-ide@vger.kernel.org
Subject: Re: [PATCH v2 19/22] ata: sata_fsl: fix scsi host initialization
Date: Tue, 4 Jan 2022 12:41:52 +0100	[thread overview]
Message-ID: <31e11af3-5a75-48d1-6f79-73db6a5d6087@suse.de> (raw)
In-Reply-To: <20220104105843.1730172-20-damien.lemoal@opensource.wdc.com>

On 1/4/22 11:58 AM, Damien Le Moal wrote:
> When compiling with W=1, the sata_fsl driver compilation throws the
> warning:
> 
> drivers/ata/sata_fsl.c:1385:22: error: initialized field overwritten
> [-Werror=override-init]
>  1385 |         .can_queue = SATA_FSL_QUEUE_DEPTH,
> 
> This is due to the driver scsi host template initialization overwriting
> the can_queue field that is already set using the ATA_NCQ_SHT()
> initializer macro, resulting in the same field being initialized twice
> in the host template declaration.
> 
> To remove this warning, introduce the ATA_SUBBASE_SHT_QD() and
> ATA_NCQ_SHT_QD() initialization macros to allow specifying a queue depth
> different from the default ATA_DEF_QUEUE using an additional argument to
> the macro.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
> ---
>  drivers/ata/sata_fsl.c |  3 +--
>  include/linux/libata.h | 11 +++++++++++
>  2 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
> index 142e65d5efc7..101d4dd79f62 100644
> --- a/drivers/ata/sata_fsl.c
> +++ b/drivers/ata/sata_fsl.c
> @@ -1380,8 +1380,7 @@ static void sata_fsl_host_stop(struct ata_host *host)
>   * scsi mid-layer and libata interface structures
>   */
>  static struct scsi_host_template sata_fsl_sht = {
> -	ATA_NCQ_SHT("sata_fsl"),
> -	.can_queue = SATA_FSL_QUEUE_DEPTH,
> +	ATA_NCQ_SHT_QD("sata_fsl", SATA_FSL_QUEUE_DEPTH),
>  	.sg_tablesize = SATA_FSL_MAX_PRD_USABLE,
>  	.dma_boundary = ATA_DMA_BOUNDARY,
>  };
> diff --git a/include/linux/libata.h b/include/linux/libata.h
> index ab2d404cde08..cafe360ab3cd 100644
> --- a/include/linux/libata.h
> +++ b/include/linux/libata.h
> @@ -1385,6 +1385,12 @@ extern const struct attribute_group *ata_common_sdev_groups[];
>  	.tag_alloc_policy	= BLK_TAG_ALLOC_RR,		\
>  	.slave_configure	= ata_scsi_slave_config
>  
> +#define ATA_SUBBASE_SHT_QD(drv_name, drv_qd)			\
> +	__ATA_BASE_SHT(drv_name),				\
> +	.can_queue		= drv_qd,			\
> +	.tag_alloc_policy	= BLK_TAG_ALLOC_RR,		\
> +	.slave_configure	= ata_scsi_slave_config
> +
>  #define ATA_BASE_SHT(drv_name)					\
>  	ATA_SUBBASE_SHT(drv_name),				\
>  	.sdev_groups		= ata_common_sdev_groups
> @@ -1396,6 +1402,11 @@ extern const struct attribute_group *ata_ncq_sdev_groups[];
>  	ATA_SUBBASE_SHT(drv_name),				\
>  	.sdev_groups		= ata_ncq_sdev_groups,		\
>  	.change_queue_depth	= ata_scsi_change_queue_depth
> +
> +#define ATA_NCQ_SHT_QD(drv_name, drv_qd)			\
> +	ATA_SUBBASE_SHT_QD(drv_name, drv_qd),			\
> +	.sdev_groups		= ata_ncq_sdev_groups,		\
> +	.change_queue_depth	= ata_scsi_change_queue_depth
>  #endif
>  
>  /*
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		           Kernel Storage Architect
hare@suse.de			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer

  reply	other threads:[~2022-01-04 11:41 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 10:58 [PATCH v2 00/22] Improve compile test coverage Damien Le Moal
2022-01-04 10:58 ` [PATCH v2 01/22] ata: sata_fsl: add compile test support Damien Le Moal
2022-01-04 11:28   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 02/22] ata: ahci_brcm: " Damien Le Moal
2022-01-04 11:28   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 03/22] ata: ahci_da850: " Damien Le Moal
2022-01-04 11:29   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 04/22] ata: ahci_dm816: " Damien Le Moal
2022-01-04 11:29   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 05/22] ata: ahci_st: " Damien Le Moal
2022-01-04 11:29   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 06/22] ata: ahci_mtk: " Damien Le Moal
2022-01-04 11:30   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 07/22] ata: ahci_mvebu: " Damien Le Moal
2022-01-04 11:30   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 08/22] ata: ahci_sunxi: " Damien Le Moal
2022-01-04 11:30   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 09/22] ata: ahci_tegra: " Damien Le Moal
2022-01-04 11:31   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 10/22] ata: ahci_xgene: " Damien Le Moal
2022-01-04 11:31   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 11/22] ata: ahci_seattle: " Damien Le Moal
2022-01-04 11:31   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 12/22] ata: pata_bk3710: " Damien Le Moal
2022-01-04 11:31   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 13/22] ata: pata_cs5535: " Damien Le Moal
2022-01-04 11:35   ` Hannes Reinecke
2022-01-06  4:50     ` Damien Le Moal
2022-01-05 22:57   ` kernel test robot
2022-01-04 10:58 ` [PATCH v2 14/22] ata: pata_ftide010: " Damien Le Moal
2022-01-04 11:35   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 15/22] ata: pata_imx: " Damien Le Moal
2022-01-04 11:35   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 16/22] ata: pata_pxa: " Damien Le Moal
2022-01-04 11:36   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 17/22] ata: pata_legacy: " Damien Le Moal
2022-01-04 11:39   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 18/22] ata: pata_samsung_cf: " Damien Le Moal
2022-01-04 11:40   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 19/22] ata: sata_fsl: fix scsi host initialization Damien Le Moal
2022-01-04 11:41   ` Hannes Reinecke [this message]
2022-01-04 10:58 ` [PATCH v2 20/22] ata: sata_fsl: fix cmdhdr_tbl_entry and prde struct definitions Damien Le Moal
2022-01-04 11:45   ` Hannes Reinecke
2022-01-05  3:39     ` Damien Le Moal
2022-01-04 10:58 ` [PATCH v2 21/22] ata: ahci_xgene: use correct type for port mmio address Damien Le Moal
2022-01-04 11:46   ` Hannes Reinecke
2022-01-04 10:58 ` [PATCH v2 22/22] ata: ahci_xgene: Fix id array access in xgene_ahci_read_id() Damien Le Moal
2022-01-04 11:51   ` Hannes Reinecke
2022-01-05  3:40     ` Damien Le Moal

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=31e11af3-5a75-48d1-6f79-73db6a5d6087@suse.de \
    --to=hare@suse.de \
    --cc=damien.lemoal@opensource.wdc.com \
    --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.