2017-08-24 09:50:23

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 0/3] constify ata_port_info

ata_port_info are not supposed to change at runtime. All functions
working with ata_port_info provided by <linux/libata.h> work with
const ata_port_info. So mark the non-const structs as const.

Arvind Yadav (3):
[PATCH 1/3] ata: ftide010: constify ata_port_info
[PATCH 2/3] ata: pdc2027x: constify ata_port_info
[PATCH 3/3] ata: constify ata_port_info

drivers/ata/pata_ftide010.c | 2 +-
drivers/ata/pata_pdc2027x.c | 2 +-
drivers/ata/pdc_adma.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

--
1.9.1


2017-08-24 09:50:27

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 1/3] ata: ftide010: constify ata_port_info

ata_port_info are not supposed to change at runtime. All functions
working with ata_port_info provided by <linux/libata.h> work with
const ata_port_info. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/ata/pata_ftide010.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/pata_ftide010.c b/drivers/ata/pata_ftide010.c
index 5d4b72e..6c04495 100644
--- a/drivers/ata/pata_ftide010.c
+++ b/drivers/ata/pata_ftide010.c
@@ -256,7 +256,7 @@ static unsigned int ftide010_qc_issue(struct ata_queued_cmd *qc)
.qc_issue = ftide010_qc_issue,
};

-static struct ata_port_info ftide010_port_info[] = {
+static const struct ata_port_info ftide010_port_info[] = {
{
.flags = ATA_FLAG_SLAVE_POSS,
.mwdma_mask = ATA_MWDMA2,
--
1.9.1

2017-08-24 09:50:33

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 3/3] ata: constify ata_port_info

ata_port_info are not supposed to change at runtime. All functions
working with ata_port_info provided by <linux/libata.h> work with
const ata_port_info. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/ata/pdc_adma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/pdc_adma.c b/drivers/ata/pdc_adma.c
index f1e873a..77c21cb 100644
--- a/drivers/ata/pdc_adma.c
+++ b/drivers/ata/pdc_adma.c
@@ -162,7 +162,7 @@ static int adma_ata_init_one(struct pci_dev *pdev,
.port_stop = adma_port_stop,
};

-static struct ata_port_info adma_port_info[] = {
+static const struct ata_port_info adma_port_info[] = {
/* board_1841_idx */
{
.flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_PIO_POLLING,
--
1.9.1

2017-08-24 09:50:52

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 2/3] ata: pdc2027x: constify ata_port_info

ata_port_info are not supposed to change at runtime. All functions
working with ata_port_info provided by <linux/libata.h> work with
const ata_port_info. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/ata/pata_pdc2027x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index 82bfd51..62ae69a 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
@@ -154,7 +154,7 @@ enum {
.set_mode = pdc2027x_set_mode,
};

-static struct ata_port_info pdc2027x_port_info[] = {
+static const struct ata_port_info pdc2027x_port_info[] = {
/* PDC_UDMA_100 */
{
.flags = ATA_FLAG_SLAVE_POSS,
--
1.9.1

2017-08-24 14:23:54

by Tejun Heo

[permalink] [raw]
Subject: Re: [PATCH 0/3] constify ata_port_info

On Thu, Aug 24, 2017 at 03:19:58PM +0530, Arvind Yadav wrote:
> ata_port_info are not supposed to change at runtime. All functions
> working with ata_port_info provided by <linux/libata.h> work with
> const ata_port_info. So mark the non-const structs as const.

Applied 1-3 to libata/for-4.14.

Thanks.

--
tejun

2017-08-24 17:26:07

by Tejun Heo

[permalink] [raw]
Subject: Re: [PATCH 0/3] constify ata_port_info

On Thu, Aug 24, 2017 at 07:23:46AM -0700, Tejun Heo wrote:
> On Thu, Aug 24, 2017 at 03:19:58PM +0530, Arvind Yadav wrote:
> > ata_port_info are not supposed to change at runtime. All functions
> > working with ata_port_info provided by <linux/libata.h> work with
> > const ata_port_info. So mark the non-const structs as const.
>
> Applied 1-3 to libata/for-4.14.

Caused build warnings. Reverted. Please test before submitting
patches.

Thanks.

--
tejun

2017-08-24 19:46:15

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 1/3] ata: ftide010: constify ata_port_info

On Thu, Aug 24, 2017 at 11:49 AM, Arvind Yadav
<[email protected]> wrote:

> ata_port_info are not supposed to change at runtime. All functions
> working with ata_port_info provided by <linux/libata.h> work with
> const ata_port_info. So mark the non-const structs as const.
>
> Signed-off-by: Arvind Yadav <[email protected]>

Acked-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij