From: Jiri Slaby <jirislaby@gmail.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: linux-kernel@vger.kernel.org, Jiri Slaby <jirislaby@gmail.com>,
Jeff Garzik <jgarzik@redhat.com>,
Alexandru Romanescu <a_romanescu@yahoo.co.uk>,
Tejun Heo <tj@kernel.org>, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: [PATCH 2/2] ATA: piix, cleanup dmi strings checking
Date: Wed, 10 Dec 2008 14:07:22 +0100 [thread overview]
Message-ID: <1228914442-30805-2-git-send-email-jirislaby@gmail.com> (raw)
In-Reply-To: <1228914442-30805-1-git-send-email-jirislaby@gmail.com>
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: Jeff Garzik <jgarzik@redhat.com>
Cc: Alexandru Romanescu <a_romanescu@yahoo.co.uk>
Cc: Tejun Heo <tj@kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
---
drivers/ata/ata_piix.c | 21 +++++++--------------
1 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index c11936e..5fdf167 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -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;
--
1.6.0.5
next prev parent reply other threads:[~2008-12-10 13:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-03 8:13 [PATCH 1/1] ATA: piix, fix pointer deref on suspend Jiri Slaby
2008-12-03 9:04 ` Tejun Heo
2008-12-03 10:13 ` Alan Cox
2008-12-03 10:39 ` Tejun Heo
2008-12-09 5:47 ` Jeff Garzik
2008-12-09 20:52 ` [PATCH 1/2] DMI: add dmi_match Jiri Slaby
2008-12-09 20:52 ` [PATCH 2/2 v2] ATA: piix, fix pointer deref on suspend Jiri Slaby
2008-12-09 21:29 ` Jeff Garzik
2008-12-09 22:06 ` Jiri Slaby
2008-12-10 13:07 ` [PATCH 1/2] DMI: add dmi_match Jiri Slaby
2008-12-10 13:07 ` Jiri Slaby [this message]
2008-12-29 12:41 ` Jeff Garzik
2008-12-11 20:27 ` [PATCH 2/2 v2] ATA: piix, fix pointer deref on suspend Andrew Morton
2008-12-11 20:34 ` Jiri Slaby
2008-12-09 20:59 ` [PATCH 1/2] DMI: add dmi_match Alan Cox
2008-12-10 2:00 ` Tejun Heo
2008-12-11 20:29 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1228914442-30805-2-git-send-email-jirislaby@gmail.com \
--to=jirislaby@gmail.com \
--cc=a_romanescu@yahoo.co.uk \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jeff@garzik.org \
--cc=jgarzik@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome