Linux ATA/IDE development
 help / color / mirror / Atom feed
* [PATCH] libata: make ata_port_type const
@ 2017-09-30 16:40 Bhumika Goyal
  2017-10-02 16:57 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Bhumika Goyal @ 2017-09-30 16:40 UTC (permalink / raw)
  To: julia.lawall, tj, linux-ide, linux-kernel; +Cc: Bhumika Goyal

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

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

end of thread, other threads:[~2017-10-02 16:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-30 16:40 [PATCH] libata: make ata_port_type const Bhumika Goyal
2017-10-02 16:57 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox