]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[libata] ata_piix: cleanup dmi strings checking
authorJiri Slaby <jirislaby@gmail.com>
Wed, 10 Dec 2008 13:07:22 +0000 (14:07 +0100)
committerJeff Garzik <jgarzik@redhat.com>
Mon, 29 Dec 2008 12:40:06 +0000 (07:40 -0500)
Commit
ATA: piix, fix pointer deref on suspend
fixed a possible oops in an ugly manner. Use newly introduced dmi_match()
to make the code pretty again.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Alexandru Romanescu <a_romanescu@yahoo.co.uk>
Cc: Tejun Heo <tj@kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/ata_piix.c

index c11936e13dd3ccd39952b35b242e42dd5e0d1078..5fdf1678d0ccc716c4fc73ec5d8b97328cdb5253 100644 (file)
@@ -1072,20 +1072,13 @@ static int piix_broken_suspend(void)
         * matching is necessary because dmi_system_id.matches is
         * limited to four entries.
         */
-       if (dmi_get_system_info(DMI_SYS_VENDOR) &&
-           dmi_get_system_info(DMI_PRODUCT_NAME) &&
-           dmi_get_system_info(DMI_PRODUCT_VERSION) &&
-           dmi_get_system_info(DMI_PRODUCT_SERIAL) &&
-           dmi_get_system_info(DMI_BOARD_VENDOR) &&
-           dmi_get_system_info(DMI_BOARD_NAME) &&
-           dmi_get_system_info(DMI_BOARD_VERSION) &&
-           !strcmp(dmi_get_system_info(DMI_SYS_VENDOR), "TOSHIBA") &&
-           !strcmp(dmi_get_system_info(DMI_PRODUCT_NAME), "000000") &&
-           !strcmp(dmi_get_system_info(DMI_PRODUCT_VERSION), "000000") &&
-           !strcmp(dmi_get_system_info(DMI_PRODUCT_SERIAL), "000000") &&
-           !strcmp(dmi_get_system_info(DMI_BOARD_VENDOR), "TOSHIBA") &&
-           !strcmp(dmi_get_system_info(DMI_BOARD_NAME), "Portable PC") &&
-           !strcmp(dmi_get_system_info(DMI_BOARD_VERSION), "Version A0"))
+       if (dmi_match(DMI_SYS_VENDOR, "TOSHIBA") &&
+           dmi_match(DMI_PRODUCT_NAME, "000000") &&
+           dmi_match(DMI_PRODUCT_VERSION, "000000") &&
+           dmi_match(DMI_PRODUCT_SERIAL, "000000") &&
+           dmi_match(DMI_BOARD_VENDOR, "TOSHIBA") &&
+           dmi_match(DMI_BOARD_NAME, "Portable PC") &&
+           dmi_match(DMI_BOARD_VERSION, "Version A0"))
                return 1;
 
        return 0;