diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2010-12-28 15:06:38 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2011-01-07 22:33:29 -0500 |
commit | 28cd4b6b4850d7588f1033c3808314b6bc2150d5 (patch) | |
tree | 6284ceef15fae977cd91adc6f28e272664a80b02 /drivers/ata/pata_hpt366.c | |
parent | dfc7e3e37d4a22ed5fd3f6e8c9842cb1246fee4f (diff) |
pata_hpt366: coding style cleanup
Fix 2 errors and 11 warnings given by checkpatch.pl:
- *switch* and *case* not on the same indentation level;
- no space between *switch* and open parenthesis;
- drive blacklist arrays not being *const*;
- spaces before tabs;
- lines over 80 characters.
In addition to these changes, also add new line after variable definition in
hpt36x_init_chipset()...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_hpt366.c')
-rw-r--r-- | drivers/ata/pata_hpt366.c | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c index 7688868557b9..d7e57db36bc8 100644 --- a/drivers/ata/pata_hpt366.c +++ b/drivers/ata/pata_hpt366.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/libata.h> | 25 | #include <linux/libata.h> |
26 | 26 | ||
27 | #define DRV_NAME "pata_hpt366" | 27 | #define DRV_NAME "pata_hpt366" |
28 | #define DRV_VERSION "0.6.8" | 28 | #define DRV_VERSION "0.6.9" |
29 | 29 | ||
30 | struct hpt_clock { | 30 | struct hpt_clock { |
31 | u8 xfer_mode; | 31 | u8 xfer_mode; |
@@ -110,18 +110,23 @@ static const struct hpt_clock hpt366_25[] = { | |||
110 | { 0, 0x01208585 } | 110 | { 0, 0x01208585 } |
111 | }; | 111 | }; |
112 | 112 | ||
113 | static const char *bad_ata33[] = { | 113 | static const char * const bad_ata33[] = { |
114 | "Maxtor 92720U8", "Maxtor 92040U6", "Maxtor 91360U4", "Maxtor 91020U3", "Maxtor 90845U3", "Maxtor 90650U2", | 114 | "Maxtor 92720U8", "Maxtor 92040U6", "Maxtor 91360U4", "Maxtor 91020U3", |
115 | "Maxtor 91360D8", "Maxtor 91190D7", "Maxtor 91020D6", "Maxtor 90845D5", "Maxtor 90680D4", "Maxtor 90510D3", "Maxtor 90340D2", | 115 | "Maxtor 90845U3", "Maxtor 90650U2", |
116 | "Maxtor 91152D8", "Maxtor 91008D7", "Maxtor 90845D6", "Maxtor 90840D6", "Maxtor 90720D5", "Maxtor 90648D5", "Maxtor 90576D4", | 116 | "Maxtor 91360D8", "Maxtor 91190D7", "Maxtor 91020D6", "Maxtor 90845D5", |
117 | "Maxtor 90680D4", "Maxtor 90510D3", "Maxtor 90340D2", | ||
118 | "Maxtor 91152D8", "Maxtor 91008D7", "Maxtor 90845D6", "Maxtor 90840D6", | ||
119 | "Maxtor 90720D5", "Maxtor 90648D5", "Maxtor 90576D4", | ||
117 | "Maxtor 90510D4", | 120 | "Maxtor 90510D4", |
118 | "Maxtor 90432D3", "Maxtor 90288D2", "Maxtor 90256D2", | 121 | "Maxtor 90432D3", "Maxtor 90288D2", "Maxtor 90256D2", |
119 | "Maxtor 91000D8", "Maxtor 90910D8", "Maxtor 90875D7", "Maxtor 90840D7", "Maxtor 90750D6", "Maxtor 90625D5", "Maxtor 90500D4", | 122 | "Maxtor 91000D8", "Maxtor 90910D8", "Maxtor 90875D7", "Maxtor 90840D7", |
120 | "Maxtor 91728D8", "Maxtor 91512D7", "Maxtor 91303D6", "Maxtor 91080D5", "Maxtor 90845D4", "Maxtor 90680D4", "Maxtor 90648D3", "Maxtor 90432D2", | 123 | "Maxtor 90750D6", "Maxtor 90625D5", "Maxtor 90500D4", |
124 | "Maxtor 91728D8", "Maxtor 91512D7", "Maxtor 91303D6", "Maxtor 91080D5", | ||
125 | "Maxtor 90845D4", "Maxtor 90680D4", "Maxtor 90648D3", "Maxtor 90432D2", | ||
121 | NULL | 126 | NULL |
122 | }; | 127 | }; |
123 | 128 | ||
124 | static const char *bad_ata66_4[] = { | 129 | static const char * const bad_ata66_4[] = { |
125 | "IBM-DTLA-307075", | 130 | "IBM-DTLA-307075", |
126 | "IBM-DTLA-307060", | 131 | "IBM-DTLA-307060", |
127 | "IBM-DTLA-307045", | 132 | "IBM-DTLA-307045", |
@@ -140,12 +145,13 @@ static const char *bad_ata66_4[] = { | |||
140 | NULL | 145 | NULL |
141 | }; | 146 | }; |
142 | 147 | ||
143 | static const char *bad_ata66_3[] = { | 148 | static const char * const bad_ata66_3[] = { |
144 | "WDC AC310200R", | 149 | "WDC AC310200R", |
145 | NULL | 150 | NULL |
146 | }; | 151 | }; |
147 | 152 | ||
148 | static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, const char *list[]) | 153 | static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, |
154 | const char * const list[]) | ||
149 | { | 155 | { |
150 | unsigned char model_num[ATA_ID_PROD_LEN + 1]; | 156 | unsigned char model_num[ATA_ID_PROD_LEN + 1]; |
151 | int i = 0; | 157 | int i = 0; |
@@ -288,6 +294,7 @@ static struct ata_port_operations hpt366_port_ops = { | |||
288 | static void hpt36x_init_chipset(struct pci_dev *dev) | 294 | static void hpt36x_init_chipset(struct pci_dev *dev) |
289 | { | 295 | { |
290 | u8 drive_fast; | 296 | u8 drive_fast; |
297 | |||
291 | pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4)); | 298 | pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4)); |
292 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x78); | 299 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x78); |
293 | pci_write_config_byte(dev, PCI_MIN_GNT, 0x08); | 300 | pci_write_config_byte(dev, PCI_MIN_GNT, 0x08); |
@@ -349,16 +356,16 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
349 | 356 | ||
350 | /* PCI clocking determines the ATA timing values to use */ | 357 | /* PCI clocking determines the ATA timing values to use */ |
351 | /* info_hpt366 is safe against re-entry so we can scribble on it */ | 358 | /* info_hpt366 is safe against re-entry so we can scribble on it */ |
352 | switch((reg1 & 0x700) >> 8) { | 359 | switch ((reg1 & 0x700) >> 8) { |
353 | case 9: | 360 | case 9: |
354 | hpriv = &hpt366_40; | 361 | hpriv = &hpt366_40; |
355 | break; | 362 | break; |
356 | case 5: | 363 | case 5: |
357 | hpriv = &hpt366_25; | 364 | hpriv = &hpt366_25; |
358 | break; | 365 | break; |
359 | default: | 366 | default: |
360 | hpriv = &hpt366_33; | 367 | hpriv = &hpt366_33; |
361 | break; | 368 | break; |
362 | } | 369 | } |
363 | /* Now kick off ATA set up */ | 370 | /* Now kick off ATA set up */ |
364 | return ata_pci_bmdma_init_one(dev, ppi, &hpt36x_sht, hpriv, 0); | 371 | return ata_pci_bmdma_init_one(dev, ppi, &hpt36x_sht, hpriv, 0); |
@@ -385,9 +392,9 @@ static const struct pci_device_id hpt36x[] = { | |||
385 | }; | 392 | }; |
386 | 393 | ||
387 | static struct pci_driver hpt36x_pci_driver = { | 394 | static struct pci_driver hpt36x_pci_driver = { |
388 | .name = DRV_NAME, | 395 | .name = DRV_NAME, |
389 | .id_table = hpt36x, | 396 | .id_table = hpt36x, |
390 | .probe = hpt36x_init_one, | 397 | .probe = hpt36x_init_one, |
391 | .remove = ata_pci_remove_one, | 398 | .remove = ata_pci_remove_one, |
392 | #ifdef CONFIG_PM | 399 | #ifdef CONFIG_PM |
393 | .suspend = ata_pci_device_suspend, | 400 | .suspend = ata_pci_device_suspend, |