From 4e57b6817880946a3a78d5d8cad1ace363f7e449 Mon Sep 17 00:00:00 2001 From: Tim Schmielau Date: Sun, 30 Oct 2005 15:03:48 -0800 Subject: [PATCH] fix missing includes I recently picked up my older work to remove unnecessary #includes of sched.h, starting from a patch by Dave Jones to not include sched.h from module.h. This reduces the number of indirect includes of sched.h by ~300. Another ~400 pointless direct includes can be removed after this disentangling (patch to follow later). However, quite a few indirect includes need to be fixed up for this. In order to feed the patches through -mm with as little disturbance as possible, I've split out the fixes I accumulated up to now (complete for i386 and x86_64, more archs to follow later) and post them before the real patch. This way this large part of the patch is kept simple with only adding #includes, and all hunks are independent of each other. So if any hunk rejects or gets in the way of other patches, just drop it. My scripts will pick it up again in the next round. Signed-off-by: Tim Schmielau Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/pnp/manager.c | 2 ++ drivers/pnp/pnpbios/rsparser.c | 2 ++ 2 files changed, 4 insertions(+) (limited to 'drivers/pnp') diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c index 94442ffd4ae..cbb2749db17 100644 --- a/drivers/pnp/manager.c +++ b/drivers/pnp/manager.c @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include "base.h" DECLARE_MUTEX(pnp_res_mutex); diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c index b0ca65b6864..5e38cd7335f 100644 --- a/drivers/pnp/pnpbios/rsparser.c +++ b/drivers/pnp/pnpbios/rsparser.c @@ -7,6 +7,8 @@ #include #include #include +#include +#include #ifdef CONFIG_PCI #include -- cgit v1.2.3 From b449f63c8ce4a517cb91f237cc3d68d083ec2dd3 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 7 Nov 2005 01:01:48 -0800 Subject: [PATCH] drivers/pnp/: cleanups This patch contains the following possible cleanups: - make needlessly global code static - #if 0 the following unused global function: - core.c: pnp_remove_device - #if 0 the following unneeded EXPORT_SYMBOL's: - card.c: pnp_add_card - card.c: pnp_remove_card - card.c: pnp_add_card_device - card.c: pnp_remove_card_device - card.c: pnp_add_card_id - core.c: pnp_register_protocol - core.c: pnp_unregister_protocol - core.c: pnp_add_device - core.c: pnp_remove_device - pnpacpi/core.c: pnpacpi_protocol - driver.c: pnp_add_id - isapnp/core.c: isapnp_read_byte - manager.c: pnp_auto_config_dev - resource.c: pnp_register_dependent_option - resource.c: pnp_register_independent_option - resource.c: pnp_register_irq_resource - resource.c: pnp_register_dma_resource - resource.c: pnp_register_port_resource - resource.c: pnp_register_mem_resource Note that this patch #if 0's exactly one functions and removes no functions. Most it does is the #if 0 of EXPORT_SYMBOL's, so if any modular code will use any of them, re-adding will be trivial. Modular ISAPnP might be interesting in some cases, but this is more legacy code. If someone would work on it to sort all the issues out (starting with the point that most users of __ISAPNP__ will have to be fixed) re-enabling the required EXPORT_SYMBOL's won't be hard for him. Signed-off-by: Adrian Bunk Cc: Adam Belay Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/pnp/card.c | 4 +++- drivers/pnp/core.c | 5 ++++- drivers/pnp/driver.c | 2 ++ drivers/pnp/isapnp/core.c | 2 ++ drivers/pnp/manager.c | 2 ++ drivers/pnp/pnpacpi/core.c | 6 ++++-- drivers/pnp/resource.c | 2 ++ 7 files changed, 19 insertions(+), 4 deletions(-) (limited to 'drivers/pnp') diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c index e95ed67d4f0..bd7c966ea2d 100644 --- a/drivers/pnp/card.c +++ b/drivers/pnp/card.c @@ -12,7 +12,7 @@ #include "base.h" LIST_HEAD(pnp_cards); -LIST_HEAD(pnp_card_drivers); +static LIST_HEAD(pnp_card_drivers); static const struct pnp_card_device_id * match_card(struct pnp_card_driver * drv, struct pnp_card * card) @@ -374,11 +374,13 @@ void pnp_unregister_card_driver(struct pnp_card_driver * drv) pnp_unregister_driver(&drv->link); } +#if 0 EXPORT_SYMBOL(pnp_add_card); EXPORT_SYMBOL(pnp_remove_card); EXPORT_SYMBOL(pnp_add_card_device); EXPORT_SYMBOL(pnp_remove_card_device); EXPORT_SYMBOL(pnp_add_card_id); +#endif /* 0 */ EXPORT_SYMBOL(pnp_request_card_device); EXPORT_SYMBOL(pnp_release_card_device); EXPORT_SYMBOL(pnp_register_card_driver); diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index deed92459bc..aec83ec5ea2 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c @@ -158,13 +158,14 @@ void __pnp_remove_device(struct pnp_dev *dev) * * this function will free all mem used by dev */ - +#if 0 void pnp_remove_device(struct pnp_dev *dev) { if (!dev || dev->card) return; __pnp_remove_device(dev); } +#endif /* 0 */ static int __init pnp_init(void) { @@ -174,7 +175,9 @@ static int __init pnp_init(void) subsys_initcall(pnp_init); +#if 0 EXPORT_SYMBOL(pnp_register_protocol); EXPORT_SYMBOL(pnp_unregister_protocol); EXPORT_SYMBOL(pnp_add_device); EXPORT_SYMBOL(pnp_remove_device); +#endif /* 0 */ diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index 33da25f3213..d3ccce706ab 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c @@ -214,6 +214,8 @@ int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) EXPORT_SYMBOL(pnp_register_driver); EXPORT_SYMBOL(pnp_unregister_driver); +#if 0 EXPORT_SYMBOL(pnp_add_id); +#endif EXPORT_SYMBOL(pnp_device_attach); EXPORT_SYMBOL(pnp_device_detach); diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index beedd86800f..57fd60314d5 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c @@ -941,7 +941,9 @@ EXPORT_SYMBOL(isapnp_protocol); EXPORT_SYMBOL(isapnp_present); EXPORT_SYMBOL(isapnp_cfg_begin); EXPORT_SYMBOL(isapnp_cfg_end); +#if 0 EXPORT_SYMBOL(isapnp_read_byte); +#endif EXPORT_SYMBOL(isapnp_write_byte); static int isapnp_read_resources(struct pnp_dev *dev, struct pnp_resource_table *res) diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c index cbb2749db17..261668618b2 100644 --- a/drivers/pnp/manager.c +++ b/drivers/pnp/manager.c @@ -555,7 +555,9 @@ void pnp_resource_change(struct resource *resource, unsigned long start, unsigne EXPORT_SYMBOL(pnp_manual_config_dev); +#if 0 EXPORT_SYMBOL(pnp_auto_config_dev); +#endif EXPORT_SYMBOL(pnp_activate_dev); EXPORT_SYMBOL(pnp_disable_dev); EXPORT_SYMBOL(pnp_resource_change); diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index 1a8915e7416..816479ad217 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c @@ -117,7 +117,7 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev) return ACPI_FAILURE(status) ? -ENODEV : 0; } -struct pnp_protocol pnpacpi_protocol = { +static struct pnp_protocol pnpacpi_protocol = { .name = "Plug and Play ACPI", .get = pnpacpi_get_resources, .set = pnpacpi_set_resources, @@ -234,7 +234,7 @@ static acpi_status __init pnpacpi_add_device_handler(acpi_handle handle, } int pnpacpi_disabled __initdata; -int __init pnpacpi_init(void) +static int __init pnpacpi_init(void) { if (acpi_disabled || pnpacpi_disabled) { pnp_info("PnP ACPI: disabled"); @@ -258,4 +258,6 @@ static int __init pnpacpi_setup(char *str) } __setup("pnpacpi=", pnpacpi_setup); +#if 0 EXPORT_SYMBOL(pnpacpi_protocol); +#endif diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index 887ad893934..6ded527169f 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c @@ -477,12 +477,14 @@ int pnp_check_dma(struct pnp_dev * dev, int idx) } +#if 0 EXPORT_SYMBOL(pnp_register_dependent_option); EXPORT_SYMBOL(pnp_register_independent_option); EXPORT_SYMBOL(pnp_register_irq_resource); EXPORT_SYMBOL(pnp_register_dma_resource); EXPORT_SYMBOL(pnp_register_port_resource); EXPORT_SYMBOL(pnp_register_mem_resource); +#endif /* 0 */ /* format is: pnp_reserve_irq=irq1[,irq2] .... */ -- cgit v1.2.3