linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ata: fix AHCI_SHT() macro definition
       [not found] <CGME20200612120932eucas1p29411e0c60963fad8c36ca35f2e6b8872@eucas1p2.samsung.com>
@ 2020-06-12 12:09 ` Bartlomiej Zolnierkiewicz
  2020-06-15  7:21   ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-06-12 12:09 UTC (permalink / raw)
  To: Jens Axboe; +Cc: kernel test robot, Christoph Hellwig, linux-ide, linux-kernel

Fix AHCI_SHT() macro definition to not reinitialize .can_queue and
.sdev_attrs fields.

This removes gcc warnings from W=1 builds such as:

  CC      drivers/ata/ahci_platform.o
In file included from drivers/ata/ahci_platform.c:21:0:
drivers/ata/ahci.h:384:16: warning: initialized field overwritten [-Woverride-init]
  .can_queue  = AHCI_MAX_CMDS,   \
                ^
drivers/ata/ahci_platform.c:40:2: note: in expansion of macro ‘AHCI_SHT’
  AHCI_SHT(DRV_NAME),
  ^
drivers/ata/ahci.h:384:16: note: (near initialization for ‘ahci_platform_sht.can_queue’)
  .can_queue  = AHCI_MAX_CMDS,   \
                ^
drivers/ata/ahci_platform.c:40:2: note: in expansion of macro ‘AHCI_SHT’
  AHCI_SHT(DRV_NAME),
  ^
drivers/ata/ahci.h:388:17: warning: initialized field overwritten [-Woverride-init]
  .sdev_attrs  = ahci_sdev_attrs
                 ^
drivers/ata/ahci_platform.c:40:2: note: in expansion of macro ‘AHCI_SHT’
  AHCI_SHT(DRV_NAME),
  ^
drivers/ata/ahci.h:388:17: note: (near initialization for ‘ahci_platform_sht.sdev_attrs’)
  .sdev_attrs  = ahci_sdev_attrs
                 ^
drivers/ata/ahci_platform.c:40:2: note: in expansion of macro ‘AHCI_SHT’
  AHCI_SHT(DRV_NAME),
  ^

Reported-by: kernel test robot <lkp@intel.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/ata/ahci.h     |    7 ++++---
 include/linux/libata.h |    3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)

Index: b/drivers/ata/ahci.h
===================================================================
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -378,15 +378,16 @@ extern struct device_attribute *ahci_sde
 
 /*
  * This must be instantiated by the edge drivers.  Read the comments
- * for ATA_BASE_SHT
+ * for __ATA_BASE_SHT
  */
 #define AHCI_SHT(drv_name)						\
-	ATA_NCQ_SHT(drv_name),						\
+	__ATA_BASE_SHT(drv_name),					\
 	.can_queue		= AHCI_MAX_CMDS,			\
 	.sg_tablesize		= AHCI_MAX_SG,				\
 	.dma_boundary		= AHCI_DMA_BOUNDARY,			\
 	.shost_attrs		= ahci_shost_attrs,			\
-	.sdev_attrs		= ahci_sdev_attrs
+	.sdev_attrs		= ahci_sdev_attrs,			\
+	.change_queue_depth	= ata_scsi_change_queue_depth
 
 extern struct ata_port_operations ahci_ops;
 extern struct ata_port_operations ahci_platform_ops;
Index: b/include/linux/libata.h
===================================================================
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1389,7 +1389,6 @@ extern struct device_attribute *ata_comm
 	ATA_SCSI_COMPAT_IOCTL					\
 	.queuecommand		= ata_scsi_queuecmd,		\
 	.dma_need_drain		= ata_scsi_dma_need_drain,	\
-	.can_queue		= ATA_DEF_QUEUE,		\
 	.tag_alloc_policy	= BLK_TAG_ALLOC_RR,		\
 	.this_id		= ATA_SHT_THIS_ID,		\
 	.emulated		= ATA_SHT_EMULATED,		\
@@ -1401,6 +1400,7 @@ extern struct device_attribute *ata_comm
 
 #define ATA_BASE_SHT(drv_name)					\
 	__ATA_BASE_SHT(drv_name),				\
+	.can_queue		= ATA_DEF_QUEUE,		\
 	.sdev_attrs		= ata_common_sdev_attrs
 
 #ifdef CONFIG_SATA_HOST
@@ -1408,6 +1408,7 @@ extern struct device_attribute *ata_ncq_
 
 #define ATA_NCQ_SHT(drv_name)					\
 	__ATA_BASE_SHT(drv_name),				\
+	.can_queue		= ATA_DEF_QUEUE,		\
 	.sdev_attrs		= ata_ncq_sdev_attrs,		\
 	.change_queue_depth	= ata_scsi_change_queue_depth
 #endif

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ata: fix AHCI_SHT() macro definition
  2020-06-12 12:09 ` [PATCH] ata: fix AHCI_SHT() macro definition Bartlomiej Zolnierkiewicz
@ 2020-06-15  7:21   ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2020-06-15  7:21 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Jens Axboe, kernel test robot, Christoph Hellwig, linux-ide,
	linux-kernel

On Fri, Jun 12, 2020 at 02:09:31PM +0200, Bartlomiej Zolnierkiewicz wrote:
> Fix AHCI_SHT() macro definition to not reinitialize .can_queue and
> .sdev_attrs fields.
> 
> This removes gcc warnings from W=1 builds such as:

I think these warnings arg bogus, at least when used with cases like
libata that want to implement inheritance schemes.  Can we get them
removed from W=1 insted if people really are about W=1 builds?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-15  7:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200612120932eucas1p29411e0c60963fad8c36ca35f2e6b8872@eucas1p2.samsung.com>
2020-06-12 12:09 ` [PATCH] ata: fix AHCI_SHT() macro definition Bartlomiej Zolnierkiewicz
2020-06-15  7:21   ` Christoph Hellwig

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).