From: David Milburn <dmilburn@redhat.com>
To: jeff@garzik.org
Cc: linux-ide@vger.kernel.org, alan@lxorguk.ukuu.org.uk, dmilburn@redhat.com
Subject: [PATCH] libata-core: support wildcard matching in ata_blacklist_entry
Date: Wed, 8 Aug 2007 15:20:57 -0500 [thread overview]
Message-ID: <20070808202057.GA23314@dhcp-210.hsv.redhat.com> (raw)
Support the use of '*' in model_num and model_rev entries
in ata_device_blacklist[].
CC: alan@lxorguk.ukuu.org.uk
Signed-off-by: David Milburn <dmilburn@redhat.com>
---
drivers/ata/libata-core.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 60e78be..1c9c208 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3806,10 +3806,17 @@ static unsigned long ata_dev_blacklisted(const struct ata_device *dev)
ata_id_c_string(dev->id, model_rev, ATA_ID_FW_REV, sizeof(model_rev));
while (ad->model_num) {
- if (!strcmp(ad->model_num, model_num)) {
+ char *wc;
+ wc = strchr(ad->model_num, '*');
+ if (!strncmp(ad->model_num, model_num,
+ wc ? wc - ad->model_num :
+ strlen(ad->model_num))) {
if (ad->model_rev == NULL)
return ad->horkage;
- if (!strcmp(ad->model_rev, model_rev))
+ wc = strchr(ad->model_rev, '*');
+ if (!strncmp(ad->model_rev, model_rev,
+ wc ? wc - ad->model_rev :
+ strlen(ad->model_rev)))
return ad->horkage;
}
ad++;
next reply other threads:[~2007-08-08 20:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-08 20:20 David Milburn [this message]
2007-08-08 23:31 ` [PATCH] libata-core: support wildcard matching in ata_blacklist_entry Alan Cox
2007-08-16 19:07 ` Jeff Garzik
-- strict thread matches above, loose matches on Subject: below --
2007-08-09 20:49 David Milburn
2007-09-20 20:33 ` Jeff Garzik
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=20070808202057.GA23314@dhcp-210.hsv.redhat.com \
--to=dmilburn@redhat.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.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;
as well as URLs for NNTP newsgroup(s).