aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2010-12-28 15:11:36 -0500
committerJeff Garzik <jgarzik@redhat.com>2011-01-07 22:33:31 -0500
commitb197f13b53681c606e59d7d9a8a1d2d54fd363fe (patch)
treef0c8af11528d82b728f701741e5272de5fb94802
parent49bfbd38bfc997e9081beabd758b2bd655d26a9c (diff)
pata_hpt3x2n: coding style cleanup
Fix 8 errors and 3 warnings given by checkpatch.pl: - *switch* and *case* not on the same indentation level; - no space between *for*/*switch*/*while* and open parenthesis; - space between an unary operator and its operand; - spaces before tabs; - lines over 80 characters. In addition to these changes, also do the following: - add new line after variable definitions; - fix the style of some multi-line comments. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r--drivers/ata/pata_hpt3x2n.c86
1 files changed, 47 insertions, 39 deletions
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c
index 809a4b4e88ab..d2239bbdb798 100644
--- a/drivers/ata/pata_hpt3x2n.c
+++ b/drivers/ata/pata_hpt3x2n.c
@@ -25,7 +25,7 @@
25#include <linux/libata.h> 25#include <linux/libata.h>
26 26
27#define DRV_NAME "pata_hpt3x2n" 27#define DRV_NAME "pata_hpt3x2n"
28#define DRV_VERSION "0.3.12" 28#define DRV_VERSION "0.3.13"
29 29
30enum { 30enum {
31 HPT_PCI_FAST = (1 << 31), 31 HPT_PCI_FAST = (1 << 31),
@@ -103,7 +103,7 @@ static u32 hpt3x2n_find_mode(struct ata_port *ap, int speed)
103{ 103{
104 struct hpt_clock *clocks = hpt3x2n_clocks; 104 struct hpt_clock *clocks = hpt3x2n_clocks;
105 105
106 while(clocks->xfer_speed) { 106 while (clocks->xfer_speed) {
107 if (clocks->xfer_speed == speed) 107 if (clocks->xfer_speed == speed)
108 return clocks->timing; 108 return clocks->timing;
109 clocks++; 109 clocks++;
@@ -169,6 +169,7 @@ static int hpt3x2n_pre_reset(struct ata_link *link, unsigned long deadline)
169{ 169{
170 struct ata_port *ap = link->ap; 170 struct ata_port *ap = link->ap;
171 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 171 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
172
172 /* Reset the state machine */ 173 /* Reset the state machine */
173 pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); 174 pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37);
174 udelay(100); 175 udelay(100);
@@ -384,12 +385,12 @@ static int hpt3xn_calibrate_dpll(struct pci_dev *dev)
384 u32 reg5c; 385 u32 reg5c;
385 int tries; 386 int tries;
386 387
387 for(tries = 0; tries < 0x5000; tries++) { 388 for (tries = 0; tries < 0x5000; tries++) {
388 udelay(50); 389 udelay(50);
389 pci_read_config_byte(dev, 0x5b, &reg5b); 390 pci_read_config_byte(dev, 0x5b, &reg5b);
390 if (reg5b & 0x80) { 391 if (reg5b & 0x80) {
391 /* See if it stays set */ 392 /* See if it stays set */
392 for(tries = 0; tries < 0x1000; tries ++) { 393 for (tries = 0; tries < 0x1000; tries++) {
393 pci_read_config_byte(dev, 0x5b, &reg5b); 394 pci_read_config_byte(dev, 0x5b, &reg5b);
394 /* Failed ? */ 395 /* Failed ? */
395 if ((reg5b & 0x80) == 0) 396 if ((reg5b & 0x80) == 0)
@@ -397,7 +398,7 @@ static int hpt3xn_calibrate_dpll(struct pci_dev *dev)
397 } 398 }
398 /* Turn off tuning, we have the DPLL set */ 399 /* Turn off tuning, we have the DPLL set */
399 pci_read_config_dword(dev, 0x5c, &reg5c); 400 pci_read_config_dword(dev, 0x5c, &reg5c);
400 pci_write_config_dword(dev, 0x5c, reg5c & ~ 0x100); 401 pci_write_config_dword(dev, 0x5c, reg5c & ~0x100);
401 return 1; 402 return 1;
402 } 403 }
403 } 404 }
@@ -501,34 +502,36 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
501 if (rc) 502 if (rc)
502 return rc; 503 return rc;
503 504
504 switch(dev->device) { 505 switch (dev->device) {
505 case PCI_DEVICE_ID_TTI_HPT366: 506 case PCI_DEVICE_ID_TTI_HPT366:
506 /* 372N if rev >= 6 */ 507 /* 372N if rev >= 6 */
507 if (rev < 6) 508 if (rev < 6)
508 return -ENODEV; 509 return -ENODEV;
509 goto hpt372n; 510 goto hpt372n;
510 case PCI_DEVICE_ID_TTI_HPT371: 511 case PCI_DEVICE_ID_TTI_HPT371:
511 /* 371N if rev >= 2 */ 512 /* 371N if rev >= 2 */
512 if (rev < 2) 513 if (rev < 2)
513 return -ENODEV; 514 return -ENODEV;
514 break; 515 break;
515 case PCI_DEVICE_ID_TTI_HPT372: 516 case PCI_DEVICE_ID_TTI_HPT372:
516 /* 372N if rev >= 2 */ 517 /* 372N if rev >= 2 */
517 if (rev < 2) 518 if (rev < 2)
518 return -ENODEV; 519 return -ENODEV;
519 goto hpt372n; 520 goto hpt372n;
520 case PCI_DEVICE_ID_TTI_HPT302: 521 case PCI_DEVICE_ID_TTI_HPT302:
521 /* 302N if rev >= 2 */ 522 /* 302N if rev >= 2 */
522 if (rev < 2) 523 if (rev < 2)
523 return -ENODEV;
524 break;
525 case PCI_DEVICE_ID_TTI_HPT372N:
526hpt372n:
527 ppi[0] = &info_hpt372n;
528 break;
529 default:
530 printk(KERN_ERR "pata_hpt3x2n: PCI table is bogus please report (%d).\n", dev->device);
531 return -ENODEV; 524 return -ENODEV;
525 break;
526 case PCI_DEVICE_ID_TTI_HPT372N:
527hpt372n:
528 ppi[0] = &info_hpt372n;
529 break;
530 default:
531 printk(KERN_ERR
532 "pata_hpt3x2n: PCI table is bogus please report (%d).\n",
533 dev->device);
534 return -ENODEV;
532 } 535 }
533 536
534 /* Ok so this is a chip we support */ 537 /* Ok so this is a chip we support */
@@ -555,8 +558,10 @@ hpt372n:
555 pci_write_config_byte(dev, 0x50, mcr1); 558 pci_write_config_byte(dev, 0x50, mcr1);
556 } 559 }
557 560
558 /* Tune the PLL. HPT recommend using 75 for SATA, 66 for UDMA133 or 561 /*
559 50 for UDMA100. Right now we always use 66 */ 562 * Tune the PLL. HPT recommend using 75 for SATA, 66 for UDMA133 or
563 * 50 for UDMA100. Right now we always use 66
564 */
560 565
561 pci_mhz = hpt3x2n_pci_clock(dev); 566 pci_mhz = hpt3x2n_pci_clock(dev);
562 567
@@ -568,7 +573,7 @@ hpt372n:
568 pci_write_config_byte(dev, 0x5B, 0x21); 573 pci_write_config_byte(dev, 0x5B, 0x21);
569 574
570 /* Unlike the 37x we don't try jiggling the frequency */ 575 /* Unlike the 37x we don't try jiggling the frequency */
571 for(adjust = 0; adjust < 8; adjust++) { 576 for (adjust = 0; adjust < 8; adjust++) {
572 if (hpt3xn_calibrate_dpll(dev)) 577 if (hpt3xn_calibrate_dpll(dev))
573 break; 578 break;
574 pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low); 579 pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low);
@@ -580,8 +585,11 @@ hpt372n:
580 585
581 printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using 66MHz DPLL.\n", 586 printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using 66MHz DPLL.\n",
582 pci_mhz); 587 pci_mhz);
583 /* Set our private data up. We only need a few flags so we use 588
584 it directly */ 589 /*
590 * Set our private data up. We only need a few flags
591 * so we use it directly.
592 */
585 if (pci_mhz > 60) 593 if (pci_mhz > 60)
586 hpriv = (void *)(PCI66 | USE_DPLL); 594 hpriv = (void *)(PCI66 | USE_DPLL);
587 595
@@ -608,9 +616,9 @@ static const struct pci_device_id hpt3x2n[] = {
608}; 616};
609 617
610static struct pci_driver hpt3x2n_pci_driver = { 618static struct pci_driver hpt3x2n_pci_driver = {
611 .name = DRV_NAME, 619 .name = DRV_NAME,
612 .id_table = hpt3x2n, 620 .id_table = hpt3x2n,
613 .probe = hpt3x2n_init_one, 621 .probe = hpt3x2n_init_one,
614 .remove = ata_pci_remove_one 622 .remove = ata_pci_remove_one
615}; 623};
616 624