mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	bzolnier@gmail.com, linux-ide@vger.kernel.org,
	Dave Jones <davej@redhat.com>
Subject: [PATCH 3/3] Make ide dma blacklist handling a bit saner.
Date: Mon, 21 May 2007 22:08:21 -0700	[thread overview]
Message-ID: <7vps4ta1iy.fsf_-_@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7v3b1pbgeo.fsf_-_@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Mon, 21 May 2007 22:01:35 -0700")

Earlier, the matching of (model,rev) in ide-dma black/white list
handling was to consider "ALL" in the table to match any
revision.  This changes the wildcard to NULL.  This way, the
DMA_BLACK_LIST macro used in the previous patch does not have to
use a slightly funky compile time constant expression to convert
NULL to "ALL".

Signed-off-by: Junio C Hamano <junkio@cox.net>
---

 * I do not really know what I am doing in the mips area, but
   that architecture specific table seems to be used by the same
   ide_in_drive_list() function, so the entries are matched to
   the updated code.

 drivers/ide/ide-dma.c                     |   14 +++++++-------
 include/asm-mips/mach-au1x00/au1xxx_ide.h |   28 ++++++++++++++--------------
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index a6a2074..c0b5b10 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -91,16 +91,16 @@
 
 static const struct drive_list_entry drive_whitelist [] = {
 
-	{ "Micropolis 2112A"	,       "ALL"		},
-	{ "CONNER CTMA 4000"	,       "ALL"		},
-	{ "CONNER CTT8000-A"	,       "ALL"		},
-	{ "ST34342A"		,	"ALL"		},
+	{ "Micropolis 2112A"	,       NULL		},
+	{ "CONNER CTMA 4000"	,       NULL		},
+	{ "CONNER CTT8000-A"	,       NULL		},
+	{ "ST34342A"		,	NULL		},
 	{ NULL			,	NULL		}
 };
 
 static const struct drive_list_entry drive_blacklist [] = {
 
-#define DMA_BLACK_LIST(model,rev) { (model), (rev==NULL ? "ALL" : (rev)) }
+#define DMA_BLACK_LIST(model,rev) { (model), (rev) }
 #include "dma-blacklist.h"
 #undef DMA_BLACK_LIST
 	{ NULL			,	NULL		}
@@ -120,8 +120,8 @@ int ide_in_drive_list(struct hd_driveid *id, const struct drive_list_entry *driv
 {
 	for ( ; drive_table->id_model ; drive_table++)
 		if ((!strcmp(drive_table->id_model, id->model)) &&
-		    ((strstr(id->fw_rev, drive_table->id_firmware)) ||
-		     (!strcmp(drive_table->id_firmware, "ALL"))))
+		    (!drive_table->id_firmware ||
+		     strstr(id->fw_rev, drive_table->id_firmware)))
 			return 1;
 	return 0;
 }
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h
index 8fcae21..4663e8b 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_ide.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h
@@ -88,26 +88,26 @@ static const struct drive_list_entry dma_white_list [] = {
 /*
  * Hitachi
  */
-        { "HITACHI_DK14FA-20"    ,       "ALL"           },
-        { "HTS726060M9AT00"      ,       "ALL"           },
+        { "HITACHI_DK14FA-20"    ,       NULL            },
+        { "HTS726060M9AT00"      ,       NULL            },
 /*
  * Maxtor
  */
-        { "Maxtor 6E040L0"      ,       "ALL"           },
-        { "Maxtor 6Y080P0"      ,       "ALL"           },
-        { "Maxtor 6Y160P0"      ,       "ALL"           },
+        { "Maxtor 6E040L0"      ,       NULL            },
+        { "Maxtor 6Y080P0"      ,       NULL            },
+        { "Maxtor 6Y160P0"      ,       NULL            },
 /*
  * Seagate
  */
-        { "ST3120026A"          ,       "ALL"           },
-        { "ST320014A"           ,       "ALL"           },
-        { "ST94011A"            ,       "ALL"           },
-        { "ST340016A"           ,       "ALL"           },
+        { "ST3120026A"          ,       NULL            },
+        { "ST320014A"           ,       NULL            },
+        { "ST94011A"            ,       NULL            },
+        { "ST340016A"           ,       NULL            },
 /*
  * Western Digital
  */
-        { "WDC WD400UE-00HCT0"  ,       "ALL"           },
-        { "WDC WD400JB-00JJC0"  ,       "ALL"           },
+        { "WDC WD400UE-00HCT0"  ,       NULL            },
+        { "WDC WD400JB-00JJC0"  ,       NULL            },
         { NULL                  ,       NULL            }
 };
 
@@ -116,9 +116,9 @@ static const struct drive_list_entry dma_black_list [] = {
 /*
  * Western Digital
  */
-        { "WDC WD100EB-00CGH0"  ,       "ALL"           },
-        { "WDC WD200BB-00AUA1"  ,       "ALL"           },
-        { "WDC AC24300L"        ,       "ALL"           },
+        { "WDC WD100EB-00CGH0"  ,       NULL            },
+        { "WDC WD200BB-00AUA1"  ,       NULL            },
+        { "WDC AC24300L"        ,       NULL            },
         { NULL                  ,       NULL            }
 };
 #endif
-- 
1.5.2.24.g93d4



  parent reply	other threads:[~2007-05-22  5:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-21 14:50 Add Seagate STT20000A to DMA blacklist Dave Jones
2007-05-21 16:15 ` Alan Cox
2007-05-21 17:27   ` Dave Jones
2007-05-22  5:01   ` [PATCH] Match DMA blacklist entries between ide-dma.c and libata-core.c Junio C Hamano
2007-05-22  5:06     ` [PATCH 2/3] Unify dma blacklist in " Junio C Hamano
2007-05-26 16:39       ` Bill Davidsen
2007-05-26 16:59       ` Alan Cox
2007-05-22  5:08     ` Junio C Hamano [this message]
2007-05-28 19:41       ` [PATCH 3/3] Make ide dma blacklist handling a bit saner Bartlomiej Zolnierkiewicz
2007-05-28 23:03         ` Junio C Hamano
2007-05-30 22:36           ` Bartlomiej Zolnierkiewicz
2007-05-28 23:10         ` [PATCH 1/3] ide_in_drive_list(): accept NULL as the wildcard for firmware revision Junio C Hamano
2007-05-30 20:43           ` Bartlomiej Zolnierkiewicz
2007-05-28 23:10         ` [PATCH 2/3] mips au1xxx_ide.h: use NULL as firmware-revision wildcard Junio C Hamano
2007-05-30 20:45           ` Bartlomiej Zolnierkiewicz
2007-05-28 23:11         ` [PATCH 3/3] ide_in_drive_list(): "ALL" is not a wildcard anymore Junio C Hamano
2007-05-30 20:47           ` Bartlomiej Zolnierkiewicz
2007-05-24  0:19     ` [PATCH] Match DMA blacklist entries between ide-dma.c and libata-core.c Bartlomiej Zolnierkiewicz
2007-05-24  0:33 ` Add Seagate STT20000A to DMA blacklist Bartlomiej Zolnierkiewicz

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=7vps4ta1iy.fsf_-_@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bzolnier@gmail.com \
    --cc=davej@redhat.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®