From 80d6da0249641a45635458da5e47a21eb2f09ed9 Mon Sep 17 00:00:00 2001 From: Alexey Starikovskiy Date: Thu, 7 Dec 2006 18:42:17 +0300 Subject: [PATCH] --- yaml --- r: 44943 b: refs/heads/master c: 78d0af3392cba6dfdd1dc1eab5a86ba8e4af8fff h: refs/heads/master i: 44941: 4c7dea6659acee8bb22876760d30465e706f8bee 44939: 8290a1e1d3004549d2ba79fb714fe36d51e0c6d9 44935: f400e00443112ecfd4925f849d560bbb463153c5 44927: e1608316f09e5a42f322bf50eb4e0da2dd9a751a v: v3 --- [refs] | 2 +- trunk/drivers/acpi/ec.c | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 1f4bf40053e3..a6023f10a157 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 523953b41e52952347d7d50dcc4bfc27bc001dc8 +refs/heads/master: 78d0af3392cba6dfdd1dc1eab5a86ba8e4af8fff diff --git a/trunk/drivers/acpi/ec.c b/trunk/drivers/acpi/ec.c index 4d17777110ed..17a98aa734b8 100644 --- a/trunk/drivers/acpi/ec.c +++ b/trunk/drivers/acpi/ec.c @@ -135,20 +135,16 @@ static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data) outb(data, ec->data_addr); } -static int acpi_ec_check_status(struct acpi_ec *ec, u8 event) +static inline int acpi_ec_check_status(struct acpi_ec *ec, u8 event) { u8 status = acpi_ec_read_status(ec); - switch (event) { - case ACPI_EC_EVENT_OBF_1: + + if (event == ACPI_EC_EVENT_OBF_1) { if (status & ACPI_EC_FLAG_OBF) return 1; - break; - case ACPI_EC_EVENT_IBF_0: + } else if (event == ACPI_EC_EVENT_IBF_0) { if (!(status & ACPI_EC_FLAG_IBF)) return 1; - break; - default: - break; } return 0; @@ -238,7 +234,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command, acpi_ec_write_cmd(ec, command); - for (; wdata_len > 0; wdata_len --) { + for (; wdata_len > 0; --wdata_len) { result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0); if (result) { printk(KERN_ERR PREFIX "write_cmd timeout, command = %d\n", @@ -259,7 +255,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command, atomic_set(&ec->query_pending, 0); } - for (; rdata_len > 0; rdata_len --) { + for (; rdata_len > 0; --rdata_len) { result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1); if (result) { printk(KERN_ERR PREFIX "read timeout, command = %d\n",