]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
libata: make ata_port_type const
authorBhumika Goyal <bhumirks@gmail.com>
Sat, 30 Sep 2017 16:40:40 +0000 (22:10 +0530)
committerTejun Heo <tj@kernel.org>
Mon, 2 Oct 2017 16:57:55 +0000 (09:57 -0700)
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>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/libata-core.c
drivers/ata/libata.h

index 65f7574afc554638a04524415abd388d5769f875..29e351669353509f9704cd85261f4cee3add17a6 100644 (file)
@@ -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,
index 839d487394b7be5ed8966c25571f75fe5b16a8b5..18bf1e995a183b793d72b4b1ebe19dc349f67388 100644 (file)
@@ -51,7 +51,7 @@ extern int atapi_passthru16;
 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);