Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1742660 > unrolled thread

[PATCH] libata: make ata_port_type const

Started byBhumika Goyal <bhumirks@gmail.com>
First post2017-09-30 18:50 +0200
Last post2017-10-02 22:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] libata: make ata_port_type const Bhumika Goyal <bhumirks@gmail.com> - 2017-09-30 18:50 +0200
    Re: [PATCH] libata: make ata_port_type const Tejun Heo <tj@kernel.org> - 2017-10-02 22:50 +0200

#1742660 — [PATCH] libata: make ata_port_type const

FromBhumika Goyal <bhumirks@gmail.com>
Date2017-09-30 18:50 +0200
Subject[PATCH] libata: make ata_port_type const
Message-ID<uvt7H-6EC-5@gated-at.bofh.it>
Make this const as it is only stored in the const field of a device
structure. Make the declaration in header const too.

Structure found using Coccinelle and changes done by hand.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/ata/libata-core.c | 2 +-
 drivers/ata/libata.h      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 65f7574..29e3516 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5824,7 +5824,7 @@ void ata_host_resume(struct ata_host *host)
 }
 #endif
 
-struct device_type ata_port_type = {
+const struct device_type ata_port_type = {
 	.name = "ata_port",
 #ifdef CONFIG_PM
 	.pm = &ata_port_pm_ops,
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index 839d487..18bf1e9 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -51,7 +51,7 @@ enum {
 extern int libata_fua;
 extern int libata_noacpi;
 extern int libata_allow_tpm;
-extern struct device_type ata_port_type;
+extern const struct device_type ata_port_type;
 extern struct ata_link *ata_dev_phys_link(struct ata_device *dev);
 extern void ata_force_cbl(struct ata_port *ap);
 extern u64 ata_tf_to_lba(const struct ata_taskfile *tf);
-- 
1.9.1

[toc] | [next] | [standalone]


#1743256

FromTejun Heo <tj@kernel.org>
Date2017-10-02 22:50 +0200
Message-ID<uwfP9-ur-105@gated-at.bofh.it>
In reply to#1742660
On Sat, Sep 30, 2017 at 10:10:40PM +0530, Bhumika Goyal wrote:
> Make this const as it is only stored in the const field of a device
> structure. Make the declaration in header const too.
> 
> Structure found using Coccinelle and changes done by hand.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

Applied to libata/for-4.15.

Thanks.

-- 
tejun

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web