libata-acpi: adjust constness in ata_acpi_gtm/stm() parameters

* No internal function uses const ata_port. Drop const from @ap.

* Make ata_acpi_stm() copy @stm before using it and change @stm to
const.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by Tejun Heo and committed by Jeff Garzik 0d02f0b2 4e520033

+6 -5
+4 -3
drivers/ata/libata-acpi.c
··· 200 200 * RETURNS: 201 201 * 0 on success, -ENOENT if _GTM doesn't exist, -errno on failure. 202 202 */ 203 - int ata_acpi_gtm(const struct ata_port *ap, struct ata_acpi_gtm *gtm) 203 + int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *gtm) 204 204 { 205 205 struct acpi_buffer output = { .length = ACPI_ALLOCATE_BUFFER }; 206 206 union acpi_object *out_obj; ··· 259 259 * RETURNS: 260 260 * 0 on success, -ENOENT if _STM doesn't exist, -errno on failure. 261 261 */ 262 - int ata_acpi_stm(const struct ata_port *ap, struct ata_acpi_gtm *stm) 262 + int ata_acpi_stm(struct ata_port *ap, const struct ata_acpi_gtm *stm) 263 263 { 264 264 acpi_status status; 265 + struct ata_acpi_gtm stm_buf = *stm; 265 266 struct acpi_object_list input; 266 267 union acpi_object in_params[3]; 267 268 268 269 in_params[0].type = ACPI_TYPE_BUFFER; 269 270 in_params[0].buffer.length = sizeof(struct ata_acpi_gtm); 270 - in_params[0].buffer.pointer = (u8 *)stm; 271 + in_params[0].buffer.pointer = (u8 *)&stm_buf; 271 272 /* Buffers for id may need byteswapping ? */ 272 273 in_params[1].type = ACPI_TYPE_BUFFER; 273 274 in_params[1].buffer.length = 512;
+2 -2
include/linux/libata.h
··· 940 940 /* libata-acpi.c */ 941 941 #ifdef CONFIG_ATA_ACPI 942 942 extern int ata_acpi_cbl_80wire(struct ata_port *ap); 943 - int ata_acpi_stm(const struct ata_port *ap, struct ata_acpi_gtm *stm); 944 - int ata_acpi_gtm(const struct ata_port *ap, struct ata_acpi_gtm *stm); 943 + int ata_acpi_stm(struct ata_port *ap, const struct ata_acpi_gtm *stm); 944 + int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *stm); 945 945 #else 946 946 static inline int ata_acpi_cbl_80wire(struct ata_port *ap) { return 0; } 947 947 #endif