From: Bhumika Goyal Date: Sat, 30 Sep 2017 16:40:40 +0000 (+0530) Subject: libata: make ata_port_type const X-Git-Tag: v4.15-rc1~100^2~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8df82c13a3756f831b0d748226ce932515728e04;p=thirdparty%2Fkernel%2Flinux.git libata: make ata_port_type const 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 Signed-off-by: Tejun Heo --- diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 65f7574afc554..29e3516693535 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 839d487394b7b..18bf1e995a183 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h @@ -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);