提交 0d02f0b2 编写于 作者: T Tejun Heo 提交者: Jeff Garzik

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: NTejun Heo <htejun@gmail.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 4e520033
...@@ -200,7 +200,7 @@ void ata_acpi_associate(struct ata_host *host) ...@@ -200,7 +200,7 @@ void ata_acpi_associate(struct ata_host *host)
* RETURNS: * RETURNS:
* 0 on success, -ENOENT if _GTM doesn't exist, -errno on failure. * 0 on success, -ENOENT if _GTM doesn't exist, -errno on failure.
*/ */
int ata_acpi_gtm(const struct ata_port *ap, struct ata_acpi_gtm *gtm) int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *gtm)
{ {
struct acpi_buffer output = { .length = ACPI_ALLOCATE_BUFFER }; struct acpi_buffer output = { .length = ACPI_ALLOCATE_BUFFER };
union acpi_object *out_obj; union acpi_object *out_obj;
...@@ -259,15 +259,16 @@ EXPORT_SYMBOL_GPL(ata_acpi_gtm); ...@@ -259,15 +259,16 @@ EXPORT_SYMBOL_GPL(ata_acpi_gtm);
* RETURNS: * RETURNS:
* 0 on success, -ENOENT if _STM doesn't exist, -errno on failure. * 0 on success, -ENOENT if _STM doesn't exist, -errno on failure.
*/ */
int ata_acpi_stm(const struct ata_port *ap, struct ata_acpi_gtm *stm) int ata_acpi_stm(struct ata_port *ap, const struct ata_acpi_gtm *stm)
{ {
acpi_status status; acpi_status status;
struct ata_acpi_gtm stm_buf = *stm;
struct acpi_object_list input; struct acpi_object_list input;
union acpi_object in_params[3]; union acpi_object in_params[3];
in_params[0].type = ACPI_TYPE_BUFFER; in_params[0].type = ACPI_TYPE_BUFFER;
in_params[0].buffer.length = sizeof(struct ata_acpi_gtm); in_params[0].buffer.length = sizeof(struct ata_acpi_gtm);
in_params[0].buffer.pointer = (u8 *)stm; in_params[0].buffer.pointer = (u8 *)&stm_buf;
/* Buffers for id may need byteswapping ? */ /* Buffers for id may need byteswapping ? */
in_params[1].type = ACPI_TYPE_BUFFER; in_params[1].type = ACPI_TYPE_BUFFER;
in_params[1].buffer.length = 512; in_params[1].buffer.length = 512;
......
...@@ -940,8 +940,8 @@ enum { ...@@ -940,8 +940,8 @@ enum {
/* libata-acpi.c */ /* libata-acpi.c */
#ifdef CONFIG_ATA_ACPI #ifdef CONFIG_ATA_ACPI
extern int ata_acpi_cbl_80wire(struct ata_port *ap); extern int ata_acpi_cbl_80wire(struct ata_port *ap);
int ata_acpi_stm(const struct ata_port *ap, struct ata_acpi_gtm *stm); int ata_acpi_stm(struct ata_port *ap, const struct ata_acpi_gtm *stm);
int ata_acpi_gtm(const struct ata_port *ap, struct ata_acpi_gtm *stm); int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *stm);
#else #else
static inline int ata_acpi_cbl_80wire(struct ata_port *ap) { return 0; } static inline int ata_acpi_cbl_80wire(struct ata_port *ap) { return 0; }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册