aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_via.c
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-05-14 19:17:00 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-05-19 17:30:32 -0400
commit07633b5d0723ce2ec31262e1096dcf61311bf078 (patch)
treed7df0c597f64b23d684e9cc492c8ee803acf21a2 /drivers/ata/pata_via.c
parent06aaca3f6301d04463b1ee0eb75c0352147159f2 (diff)
ata: remove FIT() macro
Use the kernel-provided clamp_val() macro. FIT was always applied to a member of struct ata_timing (unsigned short) and two constants. clamp_val will not cast to short anymore. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Cc: Jeff Garzik <jeff@garzik.org> Cc: Tejun Heo <htejun@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_via.c')
-rw-r--r--drivers/ata/pata_via.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index 2fea6cbe7755..708ed144ede9 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -259,15 +259,15 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo
259 259
260 pci_read_config_byte(pdev, 0x4C, &setup); 260 pci_read_config_byte(pdev, 0x4C, &setup);
261 setup &= ~(3 << shift); 261 setup &= ~(3 << shift);
262 setup |= FIT(t.setup, 1, 4) << shift; /* 1,4 or 1,4 - 1 FIXME */ 262 setup |= clamp_val(t.setup, 1, 4) << shift; /* 1,4 or 1,4 - 1 FIXME */
263 pci_write_config_byte(pdev, 0x4C, setup); 263 pci_write_config_byte(pdev, 0x4C, setup);
264 } 264 }
265 265
266 /* Load the PIO mode bits */ 266 /* Load the PIO mode bits */
267 pci_write_config_byte(pdev, 0x4F - ap->port_no, 267 pci_write_config_byte(pdev, 0x4F - ap->port_no,
268 ((FIT(t.act8b, 1, 16) - 1) << 4) | (FIT(t.rec8b, 1, 16) - 1)); 268 ((clamp_val(t.act8b, 1, 16) - 1) << 4) | (clamp_val(t.rec8b, 1, 16) - 1));
269 pci_write_config_byte(pdev, 0x48 + offset, 269 pci_write_config_byte(pdev, 0x48 + offset,
270 ((FIT(t.active, 1, 16) - 1) << 4) | (FIT(t.recover, 1, 16) - 1)); 270 ((clamp_val(t.active, 1, 16) - 1) << 4) | (clamp_val(t.recover, 1, 16) - 1));
271 271
272 /* Load the UDMA bits according to type */ 272 /* Load the UDMA bits according to type */
273 switch(udma_type) { 273 switch(udma_type) {
@@ -275,16 +275,16 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo
275 /* BUG() ? */ 275 /* BUG() ? */
276 /* fall through */ 276 /* fall through */
277 case 33: 277 case 33:
278 ut = t.udma ? (0xe0 | (FIT(t.udma, 2, 5) - 2)) : 0x03; 278 ut = t.udma ? (0xe0 | (clamp_val(t.udma, 2, 5) - 2)) : 0x03;
279 break; 279 break;
280 case 66: 280 case 66:
281 ut = t.udma ? (0xe8 | (FIT(t.udma, 2, 9) - 2)) : 0x0f; 281 ut = t.udma ? (0xe8 | (clamp_val(t.udma, 2, 9) - 2)) : 0x0f;
282 break; 282 break;
283 case 100: 283 case 100:
284 ut = t.udma ? (0xe0 | (FIT(t.udma, 2, 9) - 2)) : 0x07; 284 ut = t.udma ? (0xe0 | (clamp_val(t.udma, 2, 9) - 2)) : 0x07;
285 break; 285 break;
286 case 133: 286 case 133:
287 ut = t.udma ? (0xe0 | (FIT(t.udma, 2, 9) - 2)) : 0x07; 287 ut = t.udma ? (0xe0 | (clamp_val(t.udma, 2, 9) - 2)) : 0x07;
288 break; 288 break;
289 } 289 }
290 290