pata_hpt37x: coding style cleanup
Fix 12 errors and 15 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; - drive blacklist arrays not being *const*; - 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>
This commit is contained in:
parent
28cd4b6b48
commit
49bfbd38bf
|
@ -24,7 +24,7 @@
|
|||
#include <linux/libata.h>
|
||||
|
||||
#define DRV_NAME "pata_hpt37x"
|
||||
#define DRV_VERSION "0.6.16"
|
||||
#define DRV_VERSION "0.6.17"
|
||||
|
||||
struct hpt_clock {
|
||||
u8 xfer_speed;
|
||||
|
@ -219,7 +219,8 @@ static u32 hpt37x_find_mode(struct ata_port *ap, int speed)
|
|||
return 0xffffffffU; /* silence compiler warning */
|
||||
}
|
||||
|
||||
static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, const char *list[])
|
||||
static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr,
|
||||
const char * const list[])
|
||||
{
|
||||
unsigned char model_num[ATA_ID_PROD_LEN + 1];
|
||||
int i = 0;
|
||||
|
@ -237,18 +238,23 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, cons
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const char *bad_ata33[] = {
|
||||
"Maxtor 92720U8", "Maxtor 92040U6", "Maxtor 91360U4", "Maxtor 91020U3", "Maxtor 90845U3", "Maxtor 90650U2",
|
||||
"Maxtor 91360D8", "Maxtor 91190D7", "Maxtor 91020D6", "Maxtor 90845D5", "Maxtor 90680D4", "Maxtor 90510D3", "Maxtor 90340D2",
|
||||
"Maxtor 91152D8", "Maxtor 91008D7", "Maxtor 90845D6", "Maxtor 90840D6", "Maxtor 90720D5", "Maxtor 90648D5", "Maxtor 90576D4",
|
||||
static const char * const bad_ata33[] = {
|
||||
"Maxtor 92720U8", "Maxtor 92040U6", "Maxtor 91360U4", "Maxtor 91020U3",
|
||||
"Maxtor 90845U3", "Maxtor 90650U2",
|
||||
"Maxtor 91360D8", "Maxtor 91190D7", "Maxtor 91020D6", "Maxtor 90845D5",
|
||||
"Maxtor 90680D4", "Maxtor 90510D3", "Maxtor 90340D2",
|
||||
"Maxtor 91152D8", "Maxtor 91008D7", "Maxtor 90845D6", "Maxtor 90840D6",
|
||||
"Maxtor 90720D5", "Maxtor 90648D5", "Maxtor 90576D4",
|
||||
"Maxtor 90510D4",
|
||||
"Maxtor 90432D3", "Maxtor 90288D2", "Maxtor 90256D2",
|
||||
"Maxtor 91000D8", "Maxtor 90910D8", "Maxtor 90875D7", "Maxtor 90840D7", "Maxtor 90750D6", "Maxtor 90625D5", "Maxtor 90500D4",
|
||||
"Maxtor 91728D8", "Maxtor 91512D7", "Maxtor 91303D6", "Maxtor 91080D5", "Maxtor 90845D4", "Maxtor 90680D4", "Maxtor 90648D3", "Maxtor 90432D2",
|
||||
"Maxtor 91000D8", "Maxtor 90910D8", "Maxtor 90875D7", "Maxtor 90840D7",
|
||||
"Maxtor 90750D6", "Maxtor 90625D5", "Maxtor 90500D4",
|
||||
"Maxtor 91728D8", "Maxtor 91512D7", "Maxtor 91303D6", "Maxtor 91080D5",
|
||||
"Maxtor 90845D4", "Maxtor 90680D4", "Maxtor 90648D3", "Maxtor 90432D2",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const char *bad_ata100_5[] = {
|
||||
static const char * const bad_ata100_5[] = {
|
||||
"IBM-DTLA-307075",
|
||||
"IBM-DTLA-307060",
|
||||
"IBM-DTLA-307045",
|
||||
|
@ -389,6 +395,7 @@ static int hpt37x_pre_reset(struct ata_link *link, unsigned long deadline)
|
|||
{ 0x50, 1, 0x04, 0x04 },
|
||||
{ 0x54, 1, 0x04, 0x04 }
|
||||
};
|
||||
|
||||
if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no]))
|
||||
return -ENOENT;
|
||||
|
||||
|
@ -698,6 +705,7 @@ static u32 hpt374_read_freq(struct pci_dev *pdev)
|
|||
{
|
||||
u32 freq;
|
||||
unsigned long io_base = pci_resource_start(pdev, 4);
|
||||
|
||||
if (PCI_FUNC(pdev->devfn) & 1) {
|
||||
struct pci_dev *pdev_0;
|
||||
|
||||
|
@ -855,8 +863,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
|||
chip_table = &hpt372;
|
||||
break;
|
||||
default:
|
||||
printk(KERN_ERR "pata_hpt37x: Unknown HPT366 "
|
||||
"subtype, please report (%d).\n", rev);
|
||||
printk(KERN_ERR "pata_hpt37x: Unknown HPT366 subtype, "
|
||||
"please report (%d).\n", rev);
|
||||
return -ENODEV;
|
||||
}
|
||||
} else {
|
||||
|
@ -881,9 +889,11 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
|||
return -ENODEV;
|
||||
ppi[0] = &info_hpt302;
|
||||
chip_table = &hpt371;
|
||||
/* Single channel device, master is not present
|
||||
but the BIOS (or us for non x86) must mark it
|
||||
absent */
|
||||
/*
|
||||
* Single channel device, master is not present
|
||||
* but the BIOS (or us for non x86) must mark it
|
||||
* absent
|
||||
*/
|
||||
pci_read_config_byte(dev, 0x50, &mcr1);
|
||||
mcr1 &= ~0x04;
|
||||
pci_write_config_byte(dev, 0x50, mcr1);
|
||||
|
@ -896,7 +906,9 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
|||
*ppi = &info_hpt374_fn1;
|
||||
break;
|
||||
default:
|
||||
printk(KERN_ERR "pata_hpt37x: PCI table is bogus please report (%d).\n", dev->device);
|
||||
printk(KERN_ERR
|
||||
"pata_hpt37x: PCI table is bogus, please report (%d).\n",
|
||||
dev->device);
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
|
@ -927,9 +939,11 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
|||
if (chip_table == &hpt372a)
|
||||
outb(0x0e, iobase + 0x9c);
|
||||
|
||||
/* Some devices do not let this value be accessed via PCI space
|
||||
according to the old driver. In addition we must use the value
|
||||
from FN 0 on the HPT374 */
|
||||
/*
|
||||
* Some devices do not let this value be accessed via PCI space
|
||||
* according to the old driver. In addition we must use the value
|
||||
* from FN 0 on the HPT374.
|
||||
*/
|
||||
|
||||
if (chip_table == &hpt374) {
|
||||
freq = hpt374_read_freq(dev);
|
||||
|
@ -943,7 +957,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
|||
u8 sr;
|
||||
u32 total = 0;
|
||||
|
||||
printk(KERN_WARNING "pata_hpt37x: BIOS has not set timing clocks.\n");
|
||||
printk(KERN_WARNING
|
||||
"pata_hpt37x: BIOS has not set timing clocks.\n");
|
||||
|
||||
/* This is the process the HPT371 BIOS is reported to use */
|
||||
for (i = 0; i < 128; i++) {
|
||||
|
@ -981,17 +996,22 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
|||
|
||||
/* Select the DPLL clock. */
|
||||
pci_write_config_byte(dev, 0x5b, 0x21);
|
||||
pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low | 0x100);
|
||||
pci_write_config_dword(dev, 0x5C,
|
||||
(f_high << 16) | f_low | 0x100);
|
||||
|
||||
for (adjust = 0; adjust < 8; adjust++) {
|
||||
if (hpt37x_calibrate_dpll(dev))
|
||||
break;
|
||||
/* See if it'll settle at a fractionally different clock */
|
||||
/*
|
||||
* See if it'll settle at a fractionally
|
||||
* different clock
|
||||
*/
|
||||
if (adjust & 1)
|
||||
f_low -= adjust >> 1;
|
||||
else
|
||||
f_high += adjust >> 1;
|
||||
pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low | 0x100);
|
||||
pci_write_config_dword(dev, 0x5C,
|
||||
(f_high << 16) | f_low | 0x100);
|
||||
}
|
||||
if (adjust == 8) {
|
||||
printk(KERN_ERR "pata_hpt37x: DPLL did not stabilize!\n");
|
||||
|
|
Loading…
Reference in New Issue