linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: kernel test robot <lkp@intel.com>, Christoph Hellwig <hch@lst.de>,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ata: fix AHCI_SHT() macro definition
Date: Fri, 12 Jun 2020 14:09:31 +0200	[thread overview]
Message-ID: <0d803e72-b15e-4673-4858-4741f2772fc4@samsung.com> (raw)
In-Reply-To: <CGME20200612120932eucas1p29411e0c60963fad8c36ca35f2e6b8872@eucas1p2.samsung.com>

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

       reply	other threads:[~2020-06-12 12:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200612120932eucas1p29411e0c60963fad8c36ca35f2e6b8872@eucas1p2.samsung.com>
2020-06-12 12:09 ` Bartlomiej Zolnierkiewicz [this message]
2020-06-15  7:21   ` Christoph Hellwig

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=0d803e72-b15e-4673-4858-4741f2772fc4@samsung.com \
    --to=b.zolnierkie@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --subject='Re: [PATCH] ata: fix AHCI_SHT() macro definition' \
    /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

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