Commit 1c6e7d0a authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Len Brown

PNPACPI: whitespace cleanup

Tidy up whitespace.  No functional change.
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent b5f2490b
...@@ -36,13 +36,13 @@ static int irq_flags(int triggering, int polarity) ...@@ -36,13 +36,13 @@ static int irq_flags(int triggering, int polarity)
{ {
int flag; int flag;
if (triggering == ACPI_LEVEL_SENSITIVE) { if (triggering == ACPI_LEVEL_SENSITIVE) {
if(polarity == ACPI_ACTIVE_LOW) if (polarity == ACPI_ACTIVE_LOW)
flag = IORESOURCE_IRQ_LOWLEVEL; flag = IORESOURCE_IRQ_LOWLEVEL;
else else
flag = IORESOURCE_IRQ_HIGHLEVEL; flag = IORESOURCE_IRQ_HIGHLEVEL;
} }
else { else {
if(polarity == ACPI_ACTIVE_LOW) if (polarity == ACPI_ACTIVE_LOW)
flag = IORESOURCE_IRQ_LOWEDGE; flag = IORESOURCE_IRQ_LOWEDGE;
else else
flag = IORESOURCE_IRQ_HIGHEDGE; flag = IORESOURCE_IRQ_HIGHEDGE;
...@@ -57,7 +57,7 @@ static void decode_irq_flags(int flag, int *triggering, int *polarity) ...@@ -57,7 +57,7 @@ static void decode_irq_flags(int flag, int *triggering, int *polarity)
*triggering = ACPI_LEVEL_SENSITIVE; *triggering = ACPI_LEVEL_SENSITIVE;
*polarity = ACPI_ACTIVE_LOW; *polarity = ACPI_ACTIVE_LOW;
break; break;
case IORESOURCE_IRQ_HIGHLEVEL: case IORESOURCE_IRQ_HIGHLEVEL:
*triggering = ACPI_LEVEL_SENSITIVE; *triggering = ACPI_LEVEL_SENSITIVE;
*polarity = ACPI_ACTIVE_HIGH; *polarity = ACPI_ACTIVE_HIGH;
break; break;
...@@ -73,7 +73,7 @@ static void decode_irq_flags(int flag, int *triggering, int *polarity) ...@@ -73,7 +73,7 @@ static void decode_irq_flags(int flag, int *triggering, int *polarity)
} }
static void static void
pnpacpi_parse_allocated_irqresource(struct pnp_resource_table * res, u32 gsi, pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, u32 gsi,
int triggering, int polarity) int triggering, int polarity)
{ {
int i = 0; int i = 0;
...@@ -101,7 +101,7 @@ pnpacpi_parse_allocated_irqresource(struct pnp_resource_table * res, u32 gsi, ...@@ -101,7 +101,7 @@ pnpacpi_parse_allocated_irqresource(struct pnp_resource_table * res, u32 gsi,
} }
static void static void
pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table * res, u32 dma) pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res, u32 dma)
{ {
int i = 0; int i = 0;
while (i < PNP_MAX_DMA && while (i < PNP_MAX_DMA &&
...@@ -119,7 +119,7 @@ pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table * res, u32 dma) ...@@ -119,7 +119,7 @@ pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table * res, u32 dma)
} }
static void static void
pnpacpi_parse_allocated_ioresource(struct pnp_resource_table * res, pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
u64 io, u64 len) u64 io, u64 len)
{ {
int i = 0; int i = 0;
...@@ -138,7 +138,7 @@ pnpacpi_parse_allocated_ioresource(struct pnp_resource_table * res, ...@@ -138,7 +138,7 @@ pnpacpi_parse_allocated_ioresource(struct pnp_resource_table * res,
} }
static void static void
pnpacpi_parse_allocated_memresource(struct pnp_resource_table * res, pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res,
u64 mem, u64 len) u64 mem, u64 len)
{ {
int i = 0; int i = 0;
...@@ -181,7 +181,7 @@ pnpacpi_parse_allocated_address_space(struct pnp_resource_table *res_table, ...@@ -181,7 +181,7 @@ pnpacpi_parse_allocated_address_space(struct pnp_resource_table *res_table,
static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
void *data) void *data)
{ {
struct pnp_resource_table * res_table = (struct pnp_resource_table *)data; struct pnp_resource_table *res_table = (struct pnp_resource_table *)data;
int i; int i;
switch (res->type) { switch (res->type) {
...@@ -266,11 +266,11 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, ...@@ -266,11 +266,11 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
pnp_warn("PnPACPI: unknown resource type %d", res->type); pnp_warn("PnPACPI: unknown resource type %d", res->type);
return AE_ERROR; return AE_ERROR;
} }
return AE_OK; return AE_OK;
} }
acpi_status pnpacpi_parse_allocated_resource(acpi_handle handle, struct pnp_resource_table * res) acpi_status pnpacpi_parse_allocated_resource(acpi_handle handle, struct pnp_resource_table *res)
{ {
/* Blank the resource table values */ /* Blank the resource table values */
pnp_init_resource_table(res); pnp_init_resource_table(res);
...@@ -328,17 +328,17 @@ static void pnpacpi_parse_dma_option(struct pnp_option *option, struct acpi_reso ...@@ -328,17 +328,17 @@ static void pnpacpi_parse_dma_option(struct pnp_option *option, struct acpi_reso
pnp_err("Invalid DMA transfer type"); pnp_err("Invalid DMA transfer type");
} }
pnp_register_dma_resource(option,dma); pnp_register_dma_resource(option, dma);
return; return;
} }
static void pnpacpi_parse_irq_option(struct pnp_option *option, static void pnpacpi_parse_irq_option(struct pnp_option *option,
struct acpi_resource_irq *p) struct acpi_resource_irq *p)
{ {
int i; int i;
struct pnp_irq * irq; struct pnp_irq *irq;
if (p->interrupt_count == 0) if (p->interrupt_count == 0)
return; return;
irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL); irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL);
...@@ -358,7 +358,7 @@ static void pnpacpi_parse_ext_irq_option(struct pnp_option *option, ...@@ -358,7 +358,7 @@ static void pnpacpi_parse_ext_irq_option(struct pnp_option *option,
struct acpi_resource_extended_irq *p) struct acpi_resource_extended_irq *p)
{ {
int i; int i;
struct pnp_irq * irq; struct pnp_irq *irq;
if (p->interrupt_count == 0) if (p->interrupt_count == 0)
return; return;
...@@ -379,7 +379,7 @@ static void ...@@ -379,7 +379,7 @@ static void
pnpacpi_parse_port_option(struct pnp_option *option, pnpacpi_parse_port_option(struct pnp_option *option,
struct acpi_resource_io *io) struct acpi_resource_io *io)
{ {
struct pnp_port * port; struct pnp_port *port;
if (io->address_length == 0) if (io->address_length == 0)
return; return;
...@@ -392,7 +392,7 @@ pnpacpi_parse_port_option(struct pnp_option *option, ...@@ -392,7 +392,7 @@ pnpacpi_parse_port_option(struct pnp_option *option,
port->size = io->address_length; port->size = io->address_length;
port->flags = ACPI_DECODE_16 == io->io_decode ? port->flags = ACPI_DECODE_16 == io->io_decode ?
PNP_PORT_FLAG_16BITADDR : 0; PNP_PORT_FLAG_16BITADDR : 0;
pnp_register_port_resource(option,port); pnp_register_port_resource(option, port);
return; return;
} }
...@@ -400,7 +400,7 @@ static void ...@@ -400,7 +400,7 @@ static void
pnpacpi_parse_fixed_port_option(struct pnp_option *option, pnpacpi_parse_fixed_port_option(struct pnp_option *option,
struct acpi_resource_fixed_io *io) struct acpi_resource_fixed_io *io)
{ {
struct pnp_port * port; struct pnp_port *port;
if (io->address_length == 0) if (io->address_length == 0)
return; return;
...@@ -411,7 +411,7 @@ pnpacpi_parse_fixed_port_option(struct pnp_option *option, ...@@ -411,7 +411,7 @@ pnpacpi_parse_fixed_port_option(struct pnp_option *option,
port->size = io->address_length; port->size = io->address_length;
port->align = 0; port->align = 0;
port->flags = PNP_PORT_FLAG_FIXED; port->flags = PNP_PORT_FLAG_FIXED;
pnp_register_port_resource(option,port); pnp_register_port_resource(option, port);
return; return;
} }
...@@ -419,7 +419,7 @@ static void ...@@ -419,7 +419,7 @@ static void
pnpacpi_parse_mem24_option(struct pnp_option *option, pnpacpi_parse_mem24_option(struct pnp_option *option,
struct acpi_resource_memory24 *p) struct acpi_resource_memory24 *p)
{ {
struct pnp_mem * mem; struct pnp_mem *mem;
if (p->address_length == 0) if (p->address_length == 0)
return; return;
...@@ -434,7 +434,7 @@ pnpacpi_parse_mem24_option(struct pnp_option *option, ...@@ -434,7 +434,7 @@ pnpacpi_parse_mem24_option(struct pnp_option *option,
mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ? mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ?
IORESOURCE_MEM_WRITEABLE : 0; IORESOURCE_MEM_WRITEABLE : 0;
pnp_register_mem_resource(option,mem); pnp_register_mem_resource(option, mem);
return; return;
} }
...@@ -442,7 +442,7 @@ static void ...@@ -442,7 +442,7 @@ static void
pnpacpi_parse_mem32_option(struct pnp_option *option, pnpacpi_parse_mem32_option(struct pnp_option *option,
struct acpi_resource_memory32 *p) struct acpi_resource_memory32 *p)
{ {
struct pnp_mem * mem; struct pnp_mem *mem;
if (p->address_length == 0) if (p->address_length == 0)
return; return;
...@@ -457,7 +457,7 @@ pnpacpi_parse_mem32_option(struct pnp_option *option, ...@@ -457,7 +457,7 @@ pnpacpi_parse_mem32_option(struct pnp_option *option,
mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ? mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ?
IORESOURCE_MEM_WRITEABLE : 0; IORESOURCE_MEM_WRITEABLE : 0;
pnp_register_mem_resource(option,mem); pnp_register_mem_resource(option, mem);
return; return;
} }
...@@ -465,7 +465,7 @@ static void ...@@ -465,7 +465,7 @@ static void
pnpacpi_parse_fixed_mem32_option(struct pnp_option *option, pnpacpi_parse_fixed_mem32_option(struct pnp_option *option,
struct acpi_resource_fixed_memory32 *p) struct acpi_resource_fixed_memory32 *p)
{ {
struct pnp_mem * mem; struct pnp_mem *mem;
if (p->address_length == 0) if (p->address_length == 0)
return; return;
...@@ -479,7 +479,7 @@ pnpacpi_parse_fixed_mem32_option(struct pnp_option *option, ...@@ -479,7 +479,7 @@ pnpacpi_parse_fixed_mem32_option(struct pnp_option *option,
mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ? mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ?
IORESOURCE_MEM_WRITEABLE : 0; IORESOURCE_MEM_WRITEABLE : 0;
pnp_register_mem_resource(option,mem); pnp_register_mem_resource(option, mem);
return; return;
} }
...@@ -488,8 +488,8 @@ pnpacpi_parse_address_option(struct pnp_option *option, struct acpi_resource *r) ...@@ -488,8 +488,8 @@ pnpacpi_parse_address_option(struct pnp_option *option, struct acpi_resource *r)
{ {
struct acpi_resource_address64 addr, *p = &addr; struct acpi_resource_address64 addr, *p = &addr;
acpi_status status; acpi_status status;
struct pnp_mem * mem; struct pnp_mem *mem;
struct pnp_port * port; struct pnp_port *port;
status = acpi_resource_to_address64(r, p); status = acpi_resource_to_address64(r, p);
if (!ACPI_SUCCESS(status)) { if (!ACPI_SUCCESS(status)) {
...@@ -509,7 +509,7 @@ pnpacpi_parse_address_option(struct pnp_option *option, struct acpi_resource *r) ...@@ -509,7 +509,7 @@ pnpacpi_parse_address_option(struct pnp_option *option, struct acpi_resource *r)
mem->align = 0; mem->align = 0;
mem->flags = (p->info.mem.write_protect == mem->flags = (p->info.mem.write_protect ==
ACPI_READ_WRITE_MEMORY) ? IORESOURCE_MEM_WRITEABLE : 0; ACPI_READ_WRITE_MEMORY) ? IORESOURCE_MEM_WRITEABLE : 0;
pnp_register_mem_resource(option,mem); pnp_register_mem_resource(option, mem);
} else if (p->resource_type == ACPI_IO_RANGE) { } else if (p->resource_type == ACPI_IO_RANGE) {
port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL);
if (!port) if (!port)
...@@ -518,7 +518,7 @@ pnpacpi_parse_address_option(struct pnp_option *option, struct acpi_resource *r) ...@@ -518,7 +518,7 @@ pnpacpi_parse_address_option(struct pnp_option *option, struct acpi_resource *r)
port->size = p->address_length; port->size = p->address_length;
port->align = 0; port->align = 0;
port->flags = PNP_PORT_FLAG_FIXED; port->flags = PNP_PORT_FLAG_FIXED;
pnp_register_port_resource(option,port); pnp_register_port_resource(option, port);
} }
} }
...@@ -542,7 +542,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res, ...@@ -542,7 +542,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
break; break;
case ACPI_RESOURCE_TYPE_DMA: case ACPI_RESOURCE_TYPE_DMA:
pnpacpi_parse_dma_option(option, &res->data.dma); pnpacpi_parse_dma_option(option, &res->data.dma);
break; break;
case ACPI_RESOURCE_TYPE_START_DEPENDENT: case ACPI_RESOURCE_TYPE_START_DEPENDENT:
...@@ -550,7 +550,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res, ...@@ -550,7 +550,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
case ACPI_GOOD_CONFIGURATION: case ACPI_GOOD_CONFIGURATION:
priority = PNP_RES_PRIORITY_PREFERRED; priority = PNP_RES_PRIORITY_PREFERRED;
break; break;
case ACPI_ACCEPTABLE_CONFIGURATION: case ACPI_ACCEPTABLE_CONFIGURATION:
priority = PNP_RES_PRIORITY_ACCEPTABLE; priority = PNP_RES_PRIORITY_ACCEPTABLE;
break; break;
...@@ -566,7 +566,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res, ...@@ -566,7 +566,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
option = pnp_register_dependent_option(dev, priority); option = pnp_register_dependent_option(dev, priority);
if (!option) if (!option)
return AE_ERROR; return AE_ERROR;
parse_data->option = option; parse_data->option = option;
break; break;
case ACPI_RESOURCE_TYPE_END_DEPENDENT: case ACPI_RESOURCE_TYPE_END_DEPENDENT:
...@@ -626,7 +626,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res, ...@@ -626,7 +626,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
pnp_warn("PnPACPI: unknown resource type %d", res->type); pnp_warn("PnPACPI: unknown resource type %d", res->type);
return AE_ERROR; return AE_ERROR;
} }
return AE_OK; return AE_OK;
} }
...@@ -679,10 +679,9 @@ static acpi_status pnpacpi_count_resources(struct acpi_resource *res, ...@@ -679,10 +679,9 @@ static acpi_status pnpacpi_count_resources(struct acpi_resource *res,
return AE_OK; return AE_OK;
} }
static acpi_status pnpacpi_type_resources(struct acpi_resource *res, static acpi_status pnpacpi_type_resources(struct acpi_resource *res, void *data)
void *data)
{ {
struct acpi_resource **resource = (struct acpi_resource **)data; struct acpi_resource **resource = (struct acpi_resource **)data;
if (pnpacpi_supported_resource(res)) { if (pnpacpi_supported_resource(res)) {
(*resource)->type = res->type; (*resource)->type = res->type;
...@@ -731,9 +730,8 @@ static void pnpacpi_encode_irq(struct acpi_resource *resource, ...@@ -731,9 +730,8 @@ static void pnpacpi_encode_irq(struct acpi_resource *resource,
struct resource *p) struct resource *p)
{ {
int triggering, polarity; int triggering, polarity;
decode_irq_flags(p->flags & IORESOURCE_BITS, &triggering, decode_irq_flags(p->flags & IORESOURCE_BITS, &triggering, &polarity);
&polarity);
resource->data.irq.triggering = triggering; resource->data.irq.triggering = triggering;
resource->data.irq.polarity = polarity; resource->data.irq.polarity = polarity;
if (triggering == ACPI_EDGE_SENSITIVE) if (triggering == ACPI_EDGE_SENSITIVE)
...@@ -748,9 +746,8 @@ static void pnpacpi_encode_ext_irq(struct acpi_resource *resource, ...@@ -748,9 +746,8 @@ static void pnpacpi_encode_ext_irq(struct acpi_resource *resource,
struct resource *p) struct resource *p)
{ {
int triggering, polarity; int triggering, polarity;
decode_irq_flags(p->flags & IORESOURCE_BITS, &triggering, decode_irq_flags(p->flags & IORESOURCE_BITS, &triggering, &polarity);
&polarity);
resource->data.extended_irq.producer_consumer = ACPI_CONSUMER; resource->data.extended_irq.producer_consumer = ACPI_CONSUMER;
resource->data.extended_irq.triggering = triggering; resource->data.extended_irq.triggering = triggering;
resource->data.extended_irq.polarity = polarity; resource->data.extended_irq.polarity = polarity;
...@@ -862,37 +859,37 @@ int pnpacpi_encode_resources(struct pnp_resource_table *res_table, ...@@ -862,37 +859,37 @@ int pnpacpi_encode_resources(struct pnp_resource_table *res_table,
pnp_dbg("Encode dma"); pnp_dbg("Encode dma");
pnpacpi_encode_dma(resource, pnpacpi_encode_dma(resource,
&res_table->dma_resource[dma]); &res_table->dma_resource[dma]);
dma ++; dma++;
break; break;
case ACPI_RESOURCE_TYPE_IO: case ACPI_RESOURCE_TYPE_IO:
pnp_dbg("Encode io"); pnp_dbg("Encode io");
pnpacpi_encode_io(resource, pnpacpi_encode_io(resource,
&res_table->port_resource[port]); &res_table->port_resource[port]);
port ++; port++;
break; break;
case ACPI_RESOURCE_TYPE_FIXED_IO: case ACPI_RESOURCE_TYPE_FIXED_IO:
pnp_dbg("Encode fixed io"); pnp_dbg("Encode fixed io");
pnpacpi_encode_fixed_io(resource, pnpacpi_encode_fixed_io(resource,
&res_table->port_resource[port]); &res_table->port_resource[port]);
port ++; port++;
break; break;
case ACPI_RESOURCE_TYPE_MEMORY24: case ACPI_RESOURCE_TYPE_MEMORY24:
pnp_dbg("Encode mem24"); pnp_dbg("Encode mem24");
pnpacpi_encode_mem24(resource, pnpacpi_encode_mem24(resource,
&res_table->mem_resource[mem]); &res_table->mem_resource[mem]);
mem ++; mem++;
break; break;
case ACPI_RESOURCE_TYPE_MEMORY32: case ACPI_RESOURCE_TYPE_MEMORY32:
pnp_dbg("Encode mem32"); pnp_dbg("Encode mem32");
pnpacpi_encode_mem32(resource, pnpacpi_encode_mem32(resource,
&res_table->mem_resource[mem]); &res_table->mem_resource[mem]);
mem ++; mem++;
break; break;
case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
pnp_dbg("Encode fixed mem32"); pnp_dbg("Encode fixed mem32");
pnpacpi_encode_fixed_mem32(resource, pnpacpi_encode_fixed_mem32(resource,
&res_table->mem_resource[mem]); &res_table->mem_resource[mem]);
mem ++; mem++;
break; break;
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
pnp_dbg("Encode ext irq"); pnp_dbg("Encode ext irq");
...@@ -913,8 +910,8 @@ int pnpacpi_encode_resources(struct pnp_resource_table *res_table, ...@@ -913,8 +910,8 @@ int pnpacpi_encode_resources(struct pnp_resource_table *res_table,
pnp_warn("unknown resource type %d", resource->type); pnp_warn("unknown resource type %d", resource->type);
return -EINVAL; return -EINVAL;
} }
resource ++; resource++;
i ++; i++;
} }
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment