Skip to content

Commit

Permalink
[libata] checkpatch-inspired cleanups
Browse files Browse the repository at this point in the history
Tackle the relatively sane complaints of checkpatch --file.

The vast majority is indentation and whitespace changes, the rest are

* #include fixes
* printk KERN_xxx prefix addition
* BSS/initializer cleanups

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Jeff Garzik committed Oct 24, 2007
1 parent 01e7ae8 commit 2dcb407
Show file tree
Hide file tree
Showing 13 changed files with 262 additions and 264 deletions.
26 changes: 13 additions & 13 deletions drivers/ata/ahci.c
Expand Up @@ -227,7 +227,7 @@ struct ahci_port_priv {

static int ahci_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val);
static int ahci_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val);
static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc);
static void ahci_irq_clear(struct ata_port *ap);
static int ahci_port_start(struct ata_port *ap);
Expand Down Expand Up @@ -729,7 +729,7 @@ static int ahci_stop_engine(struct ata_port *ap)

/* wait for engine to stop. This could be as long as 500 msec */
tmp = ata_wait_register(port_mmio + PORT_CMD,
PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500);
PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500);
if (tmp & PORT_CMD_LIST_ON)
return -EIO;

Expand Down Expand Up @@ -1564,9 +1564,9 @@ static irqreturn_t ahci_interrupt(int irq, void *dev_instance)
if (!irq_stat)
return IRQ_NONE;

spin_lock(&host->lock);
spin_lock(&host->lock);

for (i = 0; i < host->n_ports; i++) {
for (i = 0; i < host->n_ports; i++) {
struct ata_port *ap;

if (!(irq_stat & (1 << i)))
Expand Down Expand Up @@ -1829,9 +1829,9 @@ static int ahci_port_start(struct ata_port *ap)
pp->cmd_tbl_dma = mem_dma;

/*
* Save off initial list of interrupts to be enabled.
* This could be changed later
*/
* Save off initial list of interrupts to be enabled.
* This could be changed later
*/
pp->intr_mask = DEF_PORT_IRQ;

ap->private_data = pp;
Expand Down Expand Up @@ -1918,12 +1918,12 @@ static void ahci_print_info(struct ata_host *host)
dev_printk(KERN_INFO, &pdev->dev,
"AHCI %02x%02x.%02x%02x "
"%u slots %u ports %s Gbps 0x%x impl %s mode\n"
,
,

(vers >> 24) & 0xff,
(vers >> 16) & 0xff,
(vers >> 8) & 0xff,
vers & 0xff,
(vers >> 24) & 0xff,
(vers >> 16) & 0xff,
(vers >> 8) & 0xff,
vers & 0xff,

((cap >> 8) & 0x1f) + 1,
(cap & 0x1f) + 1,
Expand All @@ -1935,7 +1935,7 @@ static void ahci_print_info(struct ata_host *host)
"flags: "
"%s%s%s%s%s%s%s"
"%s%s%s%s%s%s%s\n"
,
,

cap & (1 << 31) ? "64bit " : "",
cap & (1 << 30) ? "ncq " : "",
Expand Down
29 changes: 14 additions & 15 deletions drivers/ata/ata_piix.c
Expand Up @@ -157,12 +157,12 @@ struct piix_host_priv {
const int *map;
};

static int piix_init_one (struct pci_dev *pdev,
const struct pci_device_id *ent);
static int piix_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent);
static void piix_pata_error_handler(struct ata_port *ap);
static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev);
static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev);
static void ich_set_dmamode (struct ata_port *ap, struct ata_device *adev);
static void piix_set_piomode(struct ata_port *ap, struct ata_device *adev);
static void piix_set_dmamode(struct ata_port *ap, struct ata_device *adev);
static void ich_set_dmamode(struct ata_port *ap, struct ata_device *adev);
static int ich_pata_cable_detect(struct ata_port *ap);
#ifdef CONFIG_PM
static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
Expand Down Expand Up @@ -650,9 +650,9 @@ static int ich_pata_cable_detect(struct ata_port *ap)
while (lap->device) {
if (lap->device == pdev->device &&
lap->subvendor == pdev->subsystem_vendor &&
lap->subdevice == pdev->subsystem_device) {
lap->subdevice == pdev->subsystem_device)
return ATA_CBL_PATA40_SHORT;
}

lap++;
}

Expand Down Expand Up @@ -699,7 +699,7 @@ static void piix_pata_error_handler(struct ata_port *ap)
* None (inherited from caller).
*/

static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev)
static void piix_set_piomode(struct ata_port *ap, struct ata_device *adev)
{
unsigned int pio = adev->pio_mode - XFER_PIO_0;
struct pci_dev *dev = to_pci_dev(ap->host->dev);
Expand Down Expand Up @@ -786,7 +786,7 @@ static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev)
* None (inherited from caller).
*/

static void do_pata_set_dmamode (struct ata_port *ap, struct ata_device *adev, int isich)
static void do_pata_set_dmamode(struct ata_port *ap, struct ata_device *adev, int isich)
{
struct pci_dev *dev = to_pci_dev(ap->host->dev);
u8 master_port = ap->port_no ? 0x42 : 0x40;
Expand All @@ -813,7 +813,7 @@ static void do_pata_set_dmamode (struct ata_port *ap, struct ata_device *adev, i
int u_clock, u_speed;

/*
* UDMA is handled by a combination of clock switching and
* UDMA is handled by a combination of clock switching and
* selection of dividers
*
* Handy rule: Odd modes are UDMATIMx 01, even are 02
Expand Down Expand Up @@ -905,7 +905,7 @@ static void do_pata_set_dmamode (struct ata_port *ap, struct ata_device *adev, i
* None (inherited from caller).
*/

static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev)
static void piix_set_dmamode(struct ata_port *ap, struct ata_device *adev)
{
do_pata_set_dmamode(ap, adev, 0);
}
Expand All @@ -921,7 +921,7 @@ static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev)
* None (inherited from caller).
*/

static void ich_set_dmamode (struct ata_port *ap, struct ata_device *adev)
static void ich_set_dmamode(struct ata_port *ap, struct ata_device *adev)
{
do_pata_set_dmamode(ap, adev, 1);
}
Expand Down Expand Up @@ -1106,8 +1106,7 @@ static int __devinit piix_check_450nx_errata(struct pci_dev *ata_dev)
u16 cfg;
int no_piix_dma = 0;

while((pdev = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev)) != NULL)
{
while ((pdev = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev)) != NULL) {
/* Look for 450NX PXB. Check for problem configurations
A PCI quirk checks bit 6 already */
pci_read_config_word(pdev, 0x41, &cfg);
Expand Down Expand Up @@ -1241,7 +1240,7 @@ static void piix_iocfg_bit18_quirk(struct pci_dev *pdev)
* Zero on success, or -ERRNO value.
*/

static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
static int piix_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
static int printed_version;
struct device *dev = &pdev->dev;
Expand Down
16 changes: 8 additions & 8 deletions drivers/ata/libata-acpi.c
Expand Up @@ -26,7 +26,7 @@
#include <acpi/actypes.h>

#define NO_PORT_MULT 0xffff
#define SATA_ADR(root,pmp) (((root) << 16) | (pmp))
#define SATA_ADR(root, pmp) (((root) << 16) | (pmp))

#define REGS_PER_GTF 7
struct ata_acpi_gtf {
Expand Down Expand Up @@ -96,8 +96,8 @@ static void ata_acpi_associate_ide_port(struct ata_port *ap)
}
}

static void ata_acpi_handle_hotplug (struct ata_port *ap, struct kobject *kobj,
u32 event)
static void ata_acpi_handle_hotplug(struct ata_port *ap, struct kobject *kobj,
u32 event)
{
char event_string[12];
char *envp[] = { event_string, NULL };
Expand All @@ -114,7 +114,7 @@ static void ata_acpi_handle_hotplug (struct ata_port *ap, struct kobject *kobj,
}

if (kobj) {
sprintf(event_string, "BAY_EVENT=%d", event);
sprintf(event_string, "BAY_EVENT=%d", event);
kobject_uevent_env(kobj, KOBJ_CHANGE, envp);
}
}
Expand All @@ -127,14 +127,14 @@ static void ata_acpi_dev_notify(acpi_handle handle, u32 event, void *data)
if (dev->sdev)
kobj = &dev->sdev->sdev_gendev.kobj;

ata_acpi_handle_hotplug (dev->link->ap, kobj, event);
ata_acpi_handle_hotplug(dev->link->ap, kobj, event);
}

static void ata_acpi_ap_notify(acpi_handle handle, u32 event, void *data)
{
struct ata_port *ap = data;

ata_acpi_handle_hotplug (ap, &ap->dev->kobj, event);
ata_acpi_handle_hotplug(ap, &ap->dev->kobj, event);
}

/**
Expand Down Expand Up @@ -398,11 +398,11 @@ int ata_acpi_cbl_80wire(struct ata_port *ap)
{
struct ata_acpi_gtm gtm;
int valid = 0;

/* No _GTM data, no information */
if (ata_acpi_gtm(ap, &gtm) < 0)
return 0;

/* Split timing, DMA enabled */
if ((gtm.flags & 0x11) == 0x11 && gtm.drive[0].dma < 55)
valid |= 1;
Expand Down

0 comments on commit 2dcb407

Please sign in to comment.