ata: sata_fsl: fix scsi host initialization
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Tue, 4 Jan 2022 07:14:46 +0000 (16:14 +0900)
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>
Fri, 14 Jan 2022 06:17:16 +0000 (15:17 +0900)
commite5b48ee30aec1fe6dff05e36b22e886c665b4736
tree333dff1e9a973f1a43b2a5ea64d49152dde68220
parenta3d11c275b647b5b56b907011b432e00f7ddb683
ata: sata_fsl: fix scsi host initialization

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>
Reviewed-by: Hannes Reinecke <hare@suse.de>
drivers/ata/sata_fsl.c
include/linux/libata.h