Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=49fbabf56dc715bbb51e59742e82ba762790aac0
Commit:     49fbabf56dc715bbb51e59742e82ba762790aac0
Parent:     ef54d5ad2f58f899be6419fd1090cdeb2439851a
Author:     Zhao Yakui <[EMAIL PROTECTED]>
AuthorDate: Thu Nov 15 17:01:06 2007 +0800
Committer:  Len Brown <[EMAIL PROTECTED]>
CommitDate: Fri Nov 16 21:37:14 2007 -0500

    ACPI: Handle I/O access width requestst that are not a multiple of 8 bits.
    
    We've run into BIOS that hand us 4-bit access width requests
    for T-state control when the code expected only multipls of 8-bits.
    Round up.
    
    Signed-off-by: Zhao Yakui <[EMAIL PROTECTED]>
    Signed-off-by: Li Shaohua <[EMAIL PROTECTED]>
    Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 drivers/acpi/osl.c |   25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index aabc6ca..e3a673a 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -387,17 +387,14 @@ acpi_status acpi_os_read_port(acpi_io_address port, u32 * 
value, u32 width)
        if (!value)
                value = &dummy;
 
-       switch (width) {
-       case 8:
+       *value = 0;
+       if (width <= 8) {
                *(u8 *) value = inb(port);
-               break;
-       case 16:
+       } else if (width <= 16) {
                *(u16 *) value = inw(port);
-               break;
-       case 32:
+       } else if (width <= 32) {
                *(u32 *) value = inl(port);
-               break;
-       default:
+       } else {
                BUG();
        }
 
@@ -408,17 +405,13 @@ EXPORT_SYMBOL(acpi_os_read_port);
 
 acpi_status acpi_os_write_port(acpi_io_address port, u32 value, u32 width)
 {
-       switch (width) {
-       case 8:
+       if (width <= 8) {
                outb(value, port);
-               break;
-       case 16:
+       } else if (width <= 16) {
                outw(value, port);
-               break;
-       case 32:
+       } else if (width <= 32) {
                outl(value, port);
-               break;
-       default:
+       } else {
                BUG();
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to