pnp: declare PNP option parsing functions as __init
There are three kind of parse functions provided by PNP acpi/bios: - get current resources - set resources - get possible resources The first two may be needed later at runtime. The possible resource settings should never change dynamically. And even if this would make any sense (I doubt it), the current implementation only parses possible resource settings at early init time: -> declare all the option parsing __init [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Thomas Renninger <trenn@suse.de> Acked-By: Rene Herman <rene.herman@gmail.com> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
cc8259a666
commit
2bb9a6b32f
|
@ -391,7 +391,7 @@ acpi_status pnpacpi_parse_allocated_resource(acpi_handle handle,
|
|||
pnpacpi_allocated_resource, res);
|
||||
}
|
||||
|
||||
static void pnpacpi_parse_dma_option(struct pnp_option *option,
|
||||
static __init void pnpacpi_parse_dma_option(struct pnp_option *option,
|
||||
struct acpi_resource_dma *p)
|
||||
{
|
||||
int i;
|
||||
|
@ -411,7 +411,7 @@ static void pnpacpi_parse_dma_option(struct pnp_option *option,
|
|||
pnp_register_dma_resource(option, dma);
|
||||
}
|
||||
|
||||
static void pnpacpi_parse_irq_option(struct pnp_option *option,
|
||||
static __init void pnpacpi_parse_irq_option(struct pnp_option *option,
|
||||
struct acpi_resource_irq *p)
|
||||
{
|
||||
int i;
|
||||
|
@ -431,7 +431,7 @@ static void pnpacpi_parse_irq_option(struct pnp_option *option,
|
|||
pnp_register_irq_resource(option, irq);
|
||||
}
|
||||
|
||||
static void pnpacpi_parse_ext_irq_option(struct pnp_option *option,
|
||||
static __init void pnpacpi_parse_ext_irq_option(struct pnp_option *option,
|
||||
struct acpi_resource_extended_irq *p)
|
||||
{
|
||||
int i;
|
||||
|
@ -451,7 +451,7 @@ static void pnpacpi_parse_ext_irq_option(struct pnp_option *option,
|
|||
pnp_register_irq_resource(option, irq);
|
||||
}
|
||||
|
||||
static void pnpacpi_parse_port_option(struct pnp_option *option,
|
||||
static __init void pnpacpi_parse_port_option(struct pnp_option *option,
|
||||
struct acpi_resource_io *io)
|
||||
{
|
||||
struct pnp_port *port;
|
||||
|
@ -470,7 +470,7 @@ static void pnpacpi_parse_port_option(struct pnp_option *option,
|
|||
pnp_register_port_resource(option, port);
|
||||
}
|
||||
|
||||
static void pnpacpi_parse_fixed_port_option(struct pnp_option *option,
|
||||
static __init void pnpacpi_parse_fixed_port_option(struct pnp_option *option,
|
||||
struct acpi_resource_fixed_io *io)
|
||||
{
|
||||
struct pnp_port *port;
|
||||
|
@ -487,7 +487,7 @@ static void pnpacpi_parse_fixed_port_option(struct pnp_option *option,
|
|||
pnp_register_port_resource(option, port);
|
||||
}
|
||||
|
||||
static void pnpacpi_parse_mem24_option(struct pnp_option *option,
|
||||
static __init void pnpacpi_parse_mem24_option(struct pnp_option *option,
|
||||
struct acpi_resource_memory24 *p)
|
||||
{
|
||||
struct pnp_mem *mem;
|
||||
|
@ -508,7 +508,7 @@ static void pnpacpi_parse_mem24_option(struct pnp_option *option,
|
|||
pnp_register_mem_resource(option, mem);
|
||||
}
|
||||
|
||||
static void pnpacpi_parse_mem32_option(struct pnp_option *option,
|
||||
static __init void pnpacpi_parse_mem32_option(struct pnp_option *option,
|
||||
struct acpi_resource_memory32 *p)
|
||||
{
|
||||
struct pnp_mem *mem;
|
||||
|
@ -529,7 +529,7 @@ static void pnpacpi_parse_mem32_option(struct pnp_option *option,
|
|||
pnp_register_mem_resource(option, mem);
|
||||
}
|
||||
|
||||
static void pnpacpi_parse_fixed_mem32_option(struct pnp_option *option,
|
||||
static __init void pnpacpi_parse_fixed_mem32_option(struct pnp_option *option,
|
||||
struct acpi_resource_fixed_memory32 *p)
|
||||
{
|
||||
struct pnp_mem *mem;
|
||||
|
@ -549,7 +549,7 @@ static void pnpacpi_parse_fixed_mem32_option(struct pnp_option *option,
|
|||
pnp_register_mem_resource(option, mem);
|
||||
}
|
||||
|
||||
static void pnpacpi_parse_address_option(struct pnp_option *option,
|
||||
static __init void pnpacpi_parse_address_option(struct pnp_option *option,
|
||||
struct acpi_resource *r)
|
||||
{
|
||||
struct acpi_resource_address64 addr, *p = &addr;
|
||||
|
@ -596,7 +596,7 @@ struct acpipnp_parse_option_s {
|
|||
struct pnp_dev *dev;
|
||||
};
|
||||
|
||||
static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
|
||||
static __init acpi_status pnpacpi_option_resource(struct acpi_resource *res,
|
||||
void *data)
|
||||
{
|
||||
int priority = 0;
|
||||
|
@ -696,8 +696,8 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
|
|||
return AE_OK;
|
||||
}
|
||||
|
||||
acpi_status pnpacpi_parse_resource_option_data(acpi_handle handle,
|
||||
struct pnp_dev * dev)
|
||||
acpi_status __init pnpacpi_parse_resource_option_data(acpi_handle handle,
|
||||
struct pnp_dev *dev)
|
||||
{
|
||||
acpi_status status;
|
||||
struct acpipnp_parse_option_s parse_data;
|
||||
|
|
|
@ -315,7 +315,7 @@ struct pnp_protocol pnpbios_protocol = {
|
|||
.disable = pnpbios_disable_resources,
|
||||
};
|
||||
|
||||
static int insert_device(struct pnp_bios_node *node)
|
||||
static int __init insert_device(struct pnp_bios_node *node)
|
||||
{
|
||||
struct list_head *pos;
|
||||
struct pnp_dev *dev;
|
||||
|
|
|
@ -262,7 +262,7 @@ len_err:
|
|||
* Resource Configuration Options
|
||||
*/
|
||||
|
||||
static void pnpbios_parse_mem_option(unsigned char *p, int size,
|
||||
static __init void pnpbios_parse_mem_option(unsigned char *p, int size,
|
||||
struct pnp_option *option)
|
||||
{
|
||||
struct pnp_mem *mem;
|
||||
|
@ -278,7 +278,7 @@ static void pnpbios_parse_mem_option(unsigned char *p, int size,
|
|||
pnp_register_mem_resource(option, mem);
|
||||
}
|
||||
|
||||
static void pnpbios_parse_mem32_option(unsigned char *p, int size,
|
||||
static __init void pnpbios_parse_mem32_option(unsigned char *p, int size,
|
||||
struct pnp_option *option)
|
||||
{
|
||||
struct pnp_mem *mem;
|
||||
|
@ -294,7 +294,7 @@ static void pnpbios_parse_mem32_option(unsigned char *p, int size,
|
|||
pnp_register_mem_resource(option, mem);
|
||||
}
|
||||
|
||||
static void pnpbios_parse_fixed_mem32_option(unsigned char *p, int size,
|
||||
static __init void pnpbios_parse_fixed_mem32_option(unsigned char *p, int size,
|
||||
struct pnp_option *option)
|
||||
{
|
||||
struct pnp_mem *mem;
|
||||
|
@ -309,7 +309,7 @@ static void pnpbios_parse_fixed_mem32_option(unsigned char *p, int size,
|
|||
pnp_register_mem_resource(option, mem);
|
||||
}
|
||||
|
||||
static void pnpbios_parse_irq_option(unsigned char *p, int size,
|
||||
static __init void pnpbios_parse_irq_option(unsigned char *p, int size,
|
||||
struct pnp_option *option)
|
||||
{
|
||||
struct pnp_irq *irq;
|
||||
|
@ -327,7 +327,7 @@ static void pnpbios_parse_irq_option(unsigned char *p, int size,
|
|||
pnp_register_irq_resource(option, irq);
|
||||
}
|
||||
|
||||
static void pnpbios_parse_dma_option(unsigned char *p, int size,
|
||||
static __init void pnpbios_parse_dma_option(unsigned char *p, int size,
|
||||
struct pnp_option *option)
|
||||
{
|
||||
struct pnp_dma *dma;
|
||||
|
@ -340,7 +340,7 @@ static void pnpbios_parse_dma_option(unsigned char *p, int size,
|
|||
pnp_register_dma_resource(option, dma);
|
||||
}
|
||||
|
||||
static void pnpbios_parse_port_option(unsigned char *p, int size,
|
||||
static __init void pnpbios_parse_port_option(unsigned char *p, int size,
|
||||
struct pnp_option *option)
|
||||
{
|
||||
struct pnp_port *port;
|
||||
|
@ -356,7 +356,7 @@ static void pnpbios_parse_port_option(unsigned char *p, int size,
|
|||
pnp_register_port_resource(option, port);
|
||||
}
|
||||
|
||||
static void pnpbios_parse_fixed_port_option(unsigned char *p, int size,
|
||||
static __init void pnpbios_parse_fixed_port_option(unsigned char *p, int size,
|
||||
struct pnp_option *option)
|
||||
{
|
||||
struct pnp_port *port;
|
||||
|
@ -371,8 +371,8 @@ static void pnpbios_parse_fixed_port_option(unsigned char *p, int size,
|
|||
pnp_register_port_resource(option, port);
|
||||
}
|
||||
|
||||
static unsigned char *pnpbios_parse_resource_option_data(unsigned char *p,
|
||||
unsigned char *end,
|
||||
static __init unsigned char *
|
||||
pnpbios_parse_resource_option_data(unsigned char *p, unsigned char *end,
|
||||
struct pnp_dev *dev)
|
||||
{
|
||||
unsigned int len, tag;
|
||||
|
@ -781,7 +781,8 @@ len_err:
|
|||
* Core Parsing Functions
|
||||
*/
|
||||
|
||||
int pnpbios_parse_data_stream(struct pnp_dev *dev, struct pnp_bios_node *node)
|
||||
int __init pnpbios_parse_data_stream(struct pnp_dev *dev,
|
||||
struct pnp_bios_node *node)
|
||||
{
|
||||
unsigned char *p = (char *)node->data;
|
||||
unsigned char *end = (char *)(node->data + node->size);
|
||||
|
|
Loading…
Reference in New Issue