2021-05-28 11:37:54

by Lee Jones

[permalink] [raw]
Subject: [PATCH 00/11] Rid W=1 warnings from ATA

This set is part of a larger effort attempting to clean-up W=1
kernel builds, which are currently overwhelmingly riddled with
niggly little warnings.

Lee Jones (11):
ata: include: libata: Move fields commonly over-written to separate
MACRO
ata: ahci: Ensure initialised fields are not overwritten in AHCI_SHT()
ata: sata_sil24: Do not over-write initialise fields in 'sil24_sht'
ata: sata_mv: Do not over-write initialise fields in 'mv6_sht'
ata: sata_nv: Do not over-write initialise fields in 'nv_adma_sht' and
'nv_swncq_sht'
ata: pata_atiixp: Avoid overwriting initialised field in 'atiixp_sht'
ata: pata_cs5520: Avoid overwriting initialised field in 'cs5520_sht'
ata: pata_cs5530: Avoid overwriting initialised field in 'cs5530_sht'
ata: pata_sc1200: sc1200_sht'Avoid overwriting initialised field in '
ata: pata_serverworks: Avoid overwriting initialised field in
'serverworks_osb4_sht
ata: pata_macio: Avoid overwriting initialised field in
'pata_macio_sht'

drivers/ata/ahci.h | 7 +++++--
drivers/ata/pata_atiixp.c | 3 ++-
drivers/ata/pata_cs5520.c | 3 ++-
drivers/ata/pata_cs5530.c | 3 ++-
drivers/ata/pata_macio.c | 5 ++++-
drivers/ata/pata_sc1200.c | 3 ++-
drivers/ata/pata_serverworks.c | 3 ++-
drivers/ata/sata_mv.c | 6 +++++-
drivers/ata/sata_nv.c | 10 ++++++++--
drivers/ata/sata_sil24.c | 5 ++++-
include/linux/libata.h | 13 ++++++++-----
11 files changed, 44 insertions(+), 17 deletions(-)

Cc: Alan Cox <[email protected]>
Cc: ALWAYS copy <[email protected]>
Cc: Andre Hedrick <[email protected]>
Cc: ATI Inc <[email protected]>
Cc: [email protected]
Cc: Jens Axboe <[email protected]>
Cc: [email protected]
Cc: Mark Lord <[email protected]>
Cc: Philipp Zabel <[email protected]>
Cc: Tejun Heo <[email protected]>
--
2.31.1


2021-05-28 11:37:59

by Lee Jones

[permalink] [raw]
Subject: [PATCH 03/11] ata: sata_sil24: Do not over-write initialise fields in 'sil24_sht'

Fixes the following W=1 kernel build warning(s):

In file included from drivers/ata/sata_sil24.c:14:
drivers/ata/sata_sil24.c:378:16: warning: initialized field overwritten [-Woverride-init]
drivers/ata/sata_sil24.c:378:16: note: (near initialization for ‘sil24_sht.can_queue’)

Cc: Jens Axboe <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/ata/sata_sil24.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 560070d4f1d09..06a1e27c4f84a 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -374,11 +374,14 @@ static struct pci_driver sil24_pci_driver = {
};

static struct scsi_host_template sil24_sht = {
- ATA_NCQ_SHT(DRV_NAME),
+ __ATA_BASE_SHT(DRV_NAME),
.can_queue = SIL24_MAX_CMDS,
.sg_tablesize = SIL24_MAX_SGE,
.dma_boundary = ATA_DMA_BOUNDARY,
.tag_alloc_policy = BLK_TAG_ALLOC_FIFO,
+ .sdev_attrs = ata_ncq_sdev_attrs,
+ .change_queue_depth = ata_scsi_change_queue_depth,
+ .slave_configure = ata_scsi_slave_config
};

static struct ata_port_operations sil24_ops = {
--
2.31.1

2021-05-28 11:38:42

by Lee Jones

[permalink] [raw]
Subject: [PATCH 10/11] ata: pata_serverworks: Avoid overwriting initialised field in 'serverworks_osb4_sht

Fixes the following W=1 kernel build warning(s):

drivers/ata/pata_serverworks.c:257:18: warning: initialized field overwritten [-Woverride-init]
drivers/ata/pata_serverworks.c:257:18: note: (near initialization for ‘serverworks_osb4_sht.sg_tablesize’)

Cc: Jens Axboe <[email protected]>
Cc: Andre Hedrick <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/ata/pata_serverworks.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
index 7511e11eef4d6..b602e303fb54c 100644
--- a/drivers/ata/pata_serverworks.c
+++ b/drivers/ata/pata_serverworks.c
@@ -253,8 +253,9 @@ static void serverworks_set_dmamode(struct ata_port *ap, struct ata_device *adev
}

static struct scsi_host_template serverworks_osb4_sht = {
- ATA_BMDMA_SHT(DRV_NAME),
+ ATA_BASE_SHT(DRV_NAME),
.sg_tablesize = LIBATA_DUMB_MAX_PRD,
+ .dma_boundary = ATA_DMA_BOUNDARY,
};

static struct scsi_host_template serverworks_csb_sht = {
--
2.31.1

2021-05-28 11:39:00

by Lee Jones

[permalink] [raw]
Subject: [PATCH 08/11] ata: pata_cs5530: Avoid overwriting initialised field in 'cs5530_sht'

Fixes the following W=1 kernel build warning(s):

drivers/ata/pata_cs5530.c:151:18: warning: initialized field overwritten [-Woverride-init]
drivers/ata/pata_cs5530.c:151:18: note: (near initialization for ‘cs5530_sht.sg_tablesize’)

Cc: Jens Axboe <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/ata/pata_cs5530.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/pata_cs5530.c b/drivers/ata/pata_cs5530.c
index a1b4aaccaa50a..d5b7ac14e78f5 100644
--- a/drivers/ata/pata_cs5530.c
+++ b/drivers/ata/pata_cs5530.c
@@ -147,8 +147,9 @@ static unsigned int cs5530_qc_issue(struct ata_queued_cmd *qc)
}

static struct scsi_host_template cs5530_sht = {
- ATA_BMDMA_SHT(DRV_NAME),
+ ATA_BASE_SHT(DRV_NAME),
.sg_tablesize = LIBATA_DUMB_MAX_PRD,
+ .dma_boundary = ATA_DMA_BOUNDARY,
};

static struct ata_port_operations cs5530_port_ops = {
--
2.31.1

2021-05-28 11:40:41

by Lee Jones

[permalink] [raw]
Subject: [PATCH 11/11] ata: pata_macio: Avoid overwriting initialised field in 'pata_macio_sht'

Fixes the following W=1 kernel build warning(s):

drivers/ata/pata_macio.c:925:21: warning: initialized field overwritten [-Woverride-init]
drivers/ata/pata_macio.c:925:21: note: (near initialization for ‘pata_macio_sht.slave_configure’)

Cc: Jens Axboe <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/ata/pata_macio.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
index e47a28271f5bb..be0ca8d5b3452 100644
--- a/drivers/ata/pata_macio.c
+++ b/drivers/ata/pata_macio.c
@@ -914,7 +914,7 @@ static int pata_macio_do_resume(struct pata_macio_priv *priv)
#endif /* CONFIG_PM_SLEEP */

static struct scsi_host_template pata_macio_sht = {
- ATA_BASE_SHT(DRV_NAME),
+ __ATA_BASE_SHT(DRV_NAME),
.sg_tablesize = MAX_DCMDS,
/* We may not need that strict one */
.dma_boundary = ATA_DMA_BOUNDARY,
@@ -923,6 +923,9 @@ static struct scsi_host_template pata_macio_sht = {
*/
.max_segment_size = MAX_DBDMA_SEG,
.slave_configure = pata_macio_slave_config,
+ .sdev_attrs = ata_common_sdev_attrs,
+ .can_queue = ATA_DEF_QUEUE,
+ .tag_alloc_policy = BLK_TAG_ALLOC_RR,
};

static struct ata_port_operations pata_macio_ops = {
--
2.31.1

2021-05-28 11:54:58

by Lee Jones

[permalink] [raw]
Subject: [PATCH 02/11] ata: ahci: Ensure initialised fields are not overwritten in AHCI_SHT()

Fixes the following W=1 kernel build warning(s):

In file included from drivers/ata/ahci_platform.c:21:
drivers/ata/ahci.h:388:16: warning: initialized field overwritten [-Woverride-init]
drivers/ata/ahci_platform.c:40:2: note: in expansion of macro ‘AHCI_SHT’
drivers/ata/ahci.h:388:16: note: (near initialization for ‘ahci_platform_sht.can_queue’)
drivers/ata/ahci_platform.c:40:2: note: in expansion of macro ‘AHCI_SHT’
drivers/ata/ahci.h:392:17: warning: initialized field overwritten [-Woverride-init]
drivers/ata/ahci_platform.c:40:2: note: in expansion of macro ‘AHCI_SHT’
drivers/ata/ahci.h:392:17: note: (near initialization for ‘ahci_platform_sht.sdev_attrs’)
drivers/ata/ahci_platform.c:40:2: note: in expansion of macro ‘AHCI_SHT’
In file included from drivers/ata/ahci_mtk.c:18:
drivers/ata/ahci.h:388:16: warning: initialized field overwritten [-Woverride-init]
drivers/ata/ahci_mtk.c:41:2: note: in expansion of macro ‘AHCI_SHT’
drivers/ata/ahci.h:388:16: note: (near initialization for ‘ahci_platform_sht.can_queue’)
drivers/ata/ahci_mtk.c:41:2: note: in expansion of macro ‘AHCI_SHT’
drivers/ata/ahci.h:392:17: warning: initialized field overwritten [-Woverride-init]
drivers/ata/ahci_mtk.c:41:2: note: in expansion of macro ‘AHCI_SHT’
drivers/ata/ahci.h:392:17: note: (near initialization for ‘ahci_platform_sht.sdev_attrs’)
drivers/ata/ahci_mtk.c:41:2: note: in expansion of macro ‘AHCI_SHT’
In file included from drivers/ata/ahci_dm816.c:16:
drivers/ata/ahci.h:388:16: warning: initialized field overwritten [-Woverride-init]
drivers/ata/ahci_dm816.c:138:2: note: in expansion of macro ‘AHCI_SHT’
drivers/ata/ahci.h:388:16: note: (near initialization for ‘ahci_dm816_platform_sht.can_queue’)
drivers/ata/ahci_dm816.c:138:2: note: in expansion of macro ‘AHCI_SHT’
drivers/ata/ahci.h:392:17: warning: initialized field overwritten [-Woverride-init]
drivers/ata/ahci_dm816.c:138:2: note: in expansion of macro ‘AHCI_SHT’
drivers/ata/ahci.h:392:17: note: (near initialization for ‘ahci_dm816_platform_sht.sdev_attrs’)
drivers/ata/ahci_dm816.c:138:2: note: in expansion of macro ‘AHCI_SHT’

NB: Snipped 150 lines of this for brevity!

Cc: Jens Axboe <[email protected]>
Cc: Philipp Zabel <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: ALWAYS copy <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/ata/ahci.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index d1f284f0c83d9..2e89499bd9c3d 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -384,12 +384,15 @@ extern struct device_attribute *ahci_sdev_attrs[];
* 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, \
+ .tag_alloc_policy = BLK_TAG_ALLOC_RR, \
+ .slave_configure = ata_scsi_slave_config

extern struct ata_port_operations ahci_ops;
extern struct ata_port_operations ahci_platform_ops;
--
2.31.1

2021-05-28 11:54:59

by Lee Jones

[permalink] [raw]
Subject: [PATCH 05/11] ata: sata_nv: Do not over-write initialise fields in 'nv_adma_sht' and 'nv_swncq_sht'

Fixes the following W=1 kernel build warning(s):

drivers/ata/sata_nv.c:379:16: warning: initialized field overwritten [-Woverride-init]
drivers/ata/sata_nv.c:379:16: note: (near initialization for ‘nv_adma_sht.can_queue’)
drivers/ata/sata_nv.c:382:21: warning: initialized field overwritten [-Woverride-init]
drivers/ata/sata_nv.c:382:21: note: (near initialization for ‘nv_adma_sht.slave_configure’)
drivers/ata/sata_nv.c:387:16: warning: initialized field overwritten [-Woverride-init]
drivers/ata/sata_nv.c:387:16: note: (near initialization for ‘nv_swncq_sht.can_queue’)
drivers/ata/sata_nv.c:390:21: warning: initialized field overwritten [-Woverride-init]
drivers/ata/sata_nv.c:390:21: note: (near initialization for ‘nv_swncq_sht.slave_configure’)

Cc: Jens Axboe <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/ata/sata_nv.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index de45045566692..c385d18ce87b7 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -375,19 +375,25 @@ static struct scsi_host_template nv_sht = {
};

static struct scsi_host_template nv_adma_sht = {
- ATA_NCQ_SHT(DRV_NAME),
+ __ATA_BASE_SHT(DRV_NAME),
.can_queue = NV_ADMA_MAX_CPBS,
.sg_tablesize = NV_ADMA_SGTBL_TOTAL_LEN,
.dma_boundary = NV_ADMA_DMA_BOUNDARY,
.slave_configure = nv_adma_slave_config,
+ .sdev_attrs = ata_ncq_sdev_attrs,
+ .change_queue_depth = ata_scsi_change_queue_depth,
+ .tag_alloc_policy = BLK_TAG_ALLOC_RR,
};

static struct scsi_host_template nv_swncq_sht = {
- ATA_NCQ_SHT(DRV_NAME),
+ __ATA_BASE_SHT(DRV_NAME),
.can_queue = ATA_MAX_QUEUE - 1,
.sg_tablesize = LIBATA_MAX_PRD,
.dma_boundary = ATA_DMA_BOUNDARY,
.slave_configure = nv_swncq_slave_config,
+ .sdev_attrs = ata_ncq_sdev_attrs,
+ .change_queue_depth = ata_scsi_change_queue_depth,
+ .tag_alloc_policy = BLK_TAG_ALLOC_RR,
};

/*
--
2.31.1

2021-05-28 11:55:12

by Lee Jones

[permalink] [raw]
Subject: [PATCH 07/11] ata: pata_cs5520: Avoid overwriting initialised field in 'cs5520_sht'

Fixes the following W=1 kernel build warning(s):

drivers/ata/pata_cs5520.c:99:19: warning: initialized field overwritten [-Woverride-init]
drivers/ata/pata_cs5520.c:99:19: note: (near initialization for ‘cs5520_sht.sg_tablesize’)

Cc: Jens Axboe <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/ata/pata_cs5520.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c
index d09d432d3c442..247c147026243 100644
--- a/drivers/ata/pata_cs5520.c
+++ b/drivers/ata/pata_cs5520.c
@@ -95,8 +95,9 @@ static void cs5520_set_piomode(struct ata_port *ap, struct ata_device *adev)
}

static struct scsi_host_template cs5520_sht = {
- ATA_BMDMA_SHT(DRV_NAME),
+ ATA_BASE_SHT(DRV_NAME),
.sg_tablesize = LIBATA_DUMB_MAX_PRD,
+ .dma_boundary = ATA_DMA_BOUNDARY,
};

static struct ata_port_operations cs5520_port_ops = {
--
2.31.1

2021-06-16 18:25:47

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 00/11] Rid W=1 warnings from ATA

On Fri, 28 May 2021, Lee Jones wrote:

> This set is part of a larger effort attempting to clean-up W=1
> kernel builds, which are currently overwhelmingly riddled with
> niggly little warnings.
>
> Lee Jones (11):
> ata: include: libata: Move fields commonly over-written to separate
> MACRO
> ata: ahci: Ensure initialised fields are not overwritten in AHCI_SHT()
> ata: sata_sil24: Do not over-write initialise fields in 'sil24_sht'
> ata: sata_mv: Do not over-write initialise fields in 'mv6_sht'
> ata: sata_nv: Do not over-write initialise fields in 'nv_adma_sht' and
> 'nv_swncq_sht'
> ata: pata_atiixp: Avoid overwriting initialised field in 'atiixp_sht'
> ata: pata_cs5520: Avoid overwriting initialised field in 'cs5520_sht'
> ata: pata_cs5530: Avoid overwriting initialised field in 'cs5530_sht'
> ata: pata_sc1200: sc1200_sht'Avoid overwriting initialised field in '
> ata: pata_serverworks: Avoid overwriting initialised field in
> 'serverworks_osb4_sht
> ata: pata_macio: Avoid overwriting initialised field in
> 'pata_macio_sht'
>
> drivers/ata/ahci.h | 7 +++++--
> drivers/ata/pata_atiixp.c | 3 ++-
> drivers/ata/pata_cs5520.c | 3 ++-
> drivers/ata/pata_cs5530.c | 3 ++-
> drivers/ata/pata_macio.c | 5 ++++-
> drivers/ata/pata_sc1200.c | 3 ++-
> drivers/ata/pata_serverworks.c | 3 ++-
> drivers/ata/sata_mv.c | 6 +++++-
> drivers/ata/sata_nv.c | 10 ++++++++--
> drivers/ata/sata_sil24.c | 5 ++++-
> include/linux/libata.h | 13 ++++++++-----
> 11 files changed, 44 insertions(+), 17 deletions(-)
>
> Cc: Alan Cox <[email protected]>
> Cc: ALWAYS copy <[email protected]>
> Cc: Andre Hedrick <[email protected]>
> Cc: ATI Inc <[email protected]>
> Cc: [email protected]
> Cc: Jens Axboe <[email protected]>
> Cc: [email protected]
> Cc: Mark Lord <[email protected]>
> Cc: Philipp Zabel <[email protected]>
> Cc: Tejun Heo <[email protected]>

These have been on the list for just about 3 weeks now.

Is anyone planning on reviewing/merging these please?

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2021-06-16 18:32:17

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH 00/11] Rid W=1 warnings from ATA

On 5/28/21 3:04 AM, Lee Jones wrote:
> This set is part of a larger effort attempting to clean-up W=1
> kernel builds, which are currently overwhelmingly riddled with
> niggly little warnings.

Queued up for 5.14, thanks.

--
Jens Axboe

2021-06-17 10:06:22

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 00/11] Rid W=1 warnings from ATA

On Wed, 16 Jun 2021, Jens Axboe wrote:

> On 5/28/21 3:04 AM, Lee Jones wrote:
> > This set is part of a larger effort attempting to clean-up W=1
> > kernel builds, which are currently overwhelmingly riddled with
> > niggly little warnings.
>
> Queued up for 5.14, thanks.

Ideal. Thanks a bunch Jens.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog