From 1de11f7e3c5ad7dfdb7f878f89d3c801384fd3b7 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Sat, 27 Oct 2007 03:06:47 +0200 Subject: [PATCH] --- yaml --- r: 74315 b: refs/heads/master c: 1011b326b1e7ab86a480c99b4718d16e6d9f1d11 h: refs/heads/master i: 74313: 6c61d9961348974c4bcb737713f742f413cf7c0e 74311: 09e222438cc6fa37d0afe06bb5edb626598ee077 v: v3 --- [refs] | 2 +- trunk/Documentation/DocBook/Makefile | 2 +- trunk/Documentation/DocBook/uio-howto.tmpl | 90 ++++++++++++-------- trunk/drivers/base/core.c | 4 +- trunk/drivers/base/power/Makefile | 3 +- trunk/drivers/base/power/main.c | 8 +- trunk/drivers/base/power/power.h | 28 ++----- trunk/drivers/char/Kconfig | 2 +- trunk/drivers/pci/hotplug/acpiphp.h | 8 +- trunk/drivers/pci/hotplug/acpiphp_core.c | 29 ++++--- trunk/drivers/pci/hotplug/acpiphp_glue.c | 36 ++++---- trunk/drivers/pci/hotplug/acpiphp_ibm.c | 47 ++++++----- trunk/drivers/pci/hotplug/cpqphp_core.c | 41 +++++---- trunk/drivers/pci/hotplug/cpqphp_ctrl.c | 96 +++++++++++----------- trunk/drivers/pci/hotplug/fakephp.c | 14 ++-- trunk/drivers/pci/hotplug/pciehp_ctrl.c | 16 ++-- trunk/drivers/pci/hotplug/rpadlpar_core.c | 19 +++-- trunk/drivers/pci/hotplug/rpaphp_core.c | 15 +--- trunk/drivers/pci/hotplug/rpaphp_pci.c | 1 - trunk/drivers/pci/hotplug/shpchp_ctrl.c | 16 ++-- trunk/drivers/pci/pci-sysfs.c | 4 +- trunk/drivers/pci/pcie/aer/aerdrv_core.c | 29 ++++--- trunk/drivers/pci/pcie/portdrv_pci.c | 2 +- trunk/drivers/usb/host/Kconfig | 2 +- trunk/fs/exec.c | 6 -- trunk/fs/sysfs/file.c | 6 +- trunk/include/linux/sched.h | 4 - trunk/kernel/sched.c | 5 +- trunk/kernel/sched_debug.c | 8 +- trunk/kernel/sched_stats.h | 3 +- trunk/kernel/time/tick-sched.c | 2 - trunk/lib/kobject.c | 4 +- trunk/mm/page_alloc.c | 1 + trunk/mm/shmem.c | 5 +- 34 files changed, 277 insertions(+), 281 deletions(-) diff --git a/[refs] b/[refs] index f65bdaea03a7..f6ea25738cde 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 34f2c1c35ff014a5d145971e41caa940cd62d563 +refs/heads/master: 1011b326b1e7ab86a480c99b4718d16e6d9f1d11 diff --git a/trunk/Documentation/DocBook/Makefile b/trunk/Documentation/DocBook/Makefile index 4953bc258729..054a7ecf64c6 100644 --- a/trunk/Documentation/DocBook/Makefile +++ b/trunk/Documentation/DocBook/Makefile @@ -11,7 +11,7 @@ DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \ procfs-guide.xml writing_usb_driver.xml \ kernel-api.xml filesystems.xml lsm.xml usb.xml \ gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ - genericirq.xml s390-drivers.xml uio-howto.xml + genericirq.xml s390-drivers.xml ### # The build process is as follows (targets): diff --git a/trunk/Documentation/DocBook/uio-howto.tmpl b/trunk/Documentation/DocBook/uio-howto.tmpl index fdd7f4f887b7..c119484258b8 100644 --- a/trunk/Documentation/DocBook/uio-howto.tmpl +++ b/trunk/Documentation/DocBook/uio-howto.tmpl @@ -29,12 +29,6 @@ - - 0.4 - 2007-11-26 - hjk - Removed section about uio_dummy. - 0.3 2007-04-29 @@ -100,26 +94,6 @@ interested in translating it, please email me user space. This simplifies development and reduces the risk of serious bugs within a kernel module. - - Please note that UIO is not an universal driver interface. Devices - that are already handled well by other kernel subsystems (like - networking or serial or USB) are no candidates for an UIO driver. - Hardware that is ideally suited for an UIO driver fulfills all of - the following: - - - - The device has memory that can be mapped. The device can be - controlled completely by writing to this memory. - - - The device usually generates interrupts. - - - The device does not fit into one of the standard kernel - subsystems. - - @@ -200,9 +174,8 @@ interested in translating it, please email me For cards that don't generate interrupts but need to be polled, there is the possibility to set up a timer that triggers the interrupt handler at configurable time intervals. - This interrupt simulation is done by calling - uio_event_notify() - from the timer's event handler. + See drivers/uio/uio_dummy.c for an + example of this technique. @@ -290,11 +263,63 @@ offset = N * getpagesize(); + + +Using uio_dummy + + Well, there is no real use for uio_dummy. Its only purpose is + to test most parts of the UIO system (everything except + hardware interrupts), and to serve as an example for the + kernel module that you will have to write yourself. + + + +What uio_dummy does + + The kernel module uio_dummy.ko creates a + device that uses a timer to generate periodic interrupts. The + interrupt handler does nothing but increment a counter. The + driver adds two custom attributes, count + and freq, that appear under + /sys/devices/platform/uio_dummy/. + + + + The attribute count can be read and + written. The associated file + /sys/devices/platform/uio_dummy/count + appears as a normal text file and contains the total number of + timer interrupts. If you look at it (e.g. using + cat), you'll notice it is slowly counting + up. + + + + The attribute freq can be read and written. + The content of + /sys/devices/platform/uio_dummy/freq + represents the number of system timer ticks between two timer + interrupts. The default value of freq is + the value of the kernel variable HZ, which + gives you an interval of one second. Lower values will + increase the frequency. Try the following: + + +cd /sys/devices/platform/uio_dummy/ +echo 100 > freq + + + Use cat count to see how the interrupt + frequency changes. + + + + Writing your own kernel module - Please have a look at uio_cif.c as an + Please have a look at uio_dummy.c as an example. The following paragraphs explain the different sections of this file. @@ -329,8 +354,9 @@ See the description below for details. interrupt, it's your modules task to determine the irq number during initialization. If you don't have a hardware generated interrupt but want to trigger the interrupt handler in some other way, set -irq to UIO_IRQ_CUSTOM. -If you had no interrupt at all, you could set +irq to UIO_IRQ_CUSTOM. The +uio_dummy module does this as it triggers the event mechanism in a timer +routine. If you had no interrupt at all, you could set irq to UIO_IRQ_NONE, though this rarely makes sense. diff --git a/trunk/drivers/base/core.c b/trunk/drivers/base/core.c index 2683eac30c68..3f4d6aa13990 100644 --- a/trunk/drivers/base/core.c +++ b/trunk/drivers/base/core.c @@ -770,10 +770,9 @@ int device_add(struct device *dev) error = device_add_attrs(dev); if (error) goto AttrsError; - error = dpm_sysfs_add(dev); + error = device_pm_add(dev); if (error) goto PMError; - device_pm_add(dev); error = bus_add_device(dev); if (error) goto BusError; @@ -798,7 +797,6 @@ int device_add(struct device *dev) return error; BusError: device_pm_remove(dev); - dpm_sysfs_remove(dev); PMError: if (dev->bus) blocking_notifier_call_chain(&dev->bus->bus_notifier, diff --git a/trunk/drivers/base/power/Makefile b/trunk/drivers/base/power/Makefile index 44504e6618fb..a803733c839e 100644 --- a/trunk/drivers/base/power/Makefile +++ b/trunk/drivers/base/power/Makefile @@ -1,6 +1,5 @@ obj-y := shutdown.o -obj-$(CONFIG_PM) += sysfs.o -obj-$(CONFIG_PM_SLEEP) += main.o +obj-$(CONFIG_PM_SLEEP) += main.o sysfs.o obj-$(CONFIG_PM_TRACE) += trace.o ifeq ($(CONFIG_DEBUG_DRIVER),y) diff --git a/trunk/drivers/base/power/main.c b/trunk/drivers/base/power/main.c index 691ffb64cc37..0ab4ab21f564 100644 --- a/trunk/drivers/base/power/main.c +++ b/trunk/drivers/base/power/main.c @@ -38,14 +38,20 @@ static DEFINE_MUTEX(dpm_list_mtx); int (*platform_enable_wakeup)(struct device *dev, int is_on); -void device_pm_add(struct device *dev) +int device_pm_add(struct device *dev) { + int error; + pr_debug("PM: Adding info for %s:%s\n", dev->bus ? dev->bus->name : "No Bus", kobject_name(&dev->kobj)); mutex_lock(&dpm_list_mtx); list_add_tail(&dev->power.entry, &dpm_active); + error = dpm_sysfs_add(dev); + if (error) + list_del(&dev->power.entry); mutex_unlock(&dpm_list_mtx); + return error; } void device_pm_remove(struct device *dev) diff --git a/trunk/drivers/base/power/power.h b/trunk/drivers/base/power/power.h index 379da4e958e0..5c4efd493fa5 100644 --- a/trunk/drivers/base/power/power.h +++ b/trunk/drivers/base/power/power.h @@ -13,29 +13,14 @@ extern void device_shutdown(void); extern struct list_head dpm_active; /* The active device list */ -static inline struct device *to_device(struct list_head *entry) +static inline struct device * to_device(struct list_head * entry) { return container_of(entry, struct device, power.entry); } -extern void device_pm_add(struct device *); +extern int device_pm_add(struct device *); extern void device_pm_remove(struct device *); -#else /* CONFIG_PM_SLEEP */ - - -static inline void device_pm_add(struct device *dev) -{ -} - -static inline void device_pm_remove(struct device *dev) -{ -} - -#endif - -#ifdef CONFIG_PM - /* * sysfs.c */ @@ -43,15 +28,16 @@ static inline void device_pm_remove(struct device *dev) extern int dpm_sysfs_add(struct device *); extern void dpm_sysfs_remove(struct device *); -#else /* CONFIG_PM */ +#else /* CONFIG_PM_SLEEP */ + -static inline int dpm_sysfs_add(struct device *dev) +static inline int device_pm_add(struct device * dev) { return 0; } - -static inline void dpm_sysfs_remove(struct device *dev) +static inline void device_pm_remove(struct device * dev) { + } #endif diff --git a/trunk/drivers/char/Kconfig b/trunk/drivers/char/Kconfig index a509b8d79781..bf18d757b876 100644 --- a/trunk/drivers/char/Kconfig +++ b/trunk/drivers/char/Kconfig @@ -457,7 +457,7 @@ config LEGACY_PTYS config LEGACY_PTY_COUNT int "Maximum number of legacy PTY in use" depends on LEGACY_PTYS - range 0 256 + range 1 256 default "256" ---help--- The maximum number of legacy PTYs that can be used at any one time. diff --git a/trunk/drivers/pci/hotplug/acpiphp.h b/trunk/drivers/pci/hotplug/acpiphp.h index 1ef417cca2db..f6cc0c5b5657 100644 --- a/trunk/drivers/pci/hotplug/acpiphp.h +++ b/trunk/drivers/pci/hotplug/acpiphp.h @@ -66,7 +66,7 @@ struct slot { char name[SLOT_NAME_SIZE]; }; -/* +/** * struct acpiphp_bridge - PCI bridge information * * for each bridge device in ACPI namespace @@ -97,7 +97,7 @@ struct acpiphp_bridge { }; -/* +/** * struct acpiphp_slot - PCI slot information * * PCI slot information for each *physical* PCI slot @@ -118,7 +118,7 @@ struct acpiphp_slot { }; -/* +/** * struct acpiphp_func - PCI function information * * PCI function information for each object in ACPI namespace @@ -137,7 +137,7 @@ struct acpiphp_func { u32 flags; /* see below */ }; -/* +/** * struct acpiphp_attention_info - device specific attention registration * * ACPI has no generic method of setting/getting attention status diff --git a/trunk/drivers/pci/hotplug/acpiphp_core.c b/trunk/drivers/pci/hotplug/acpiphp_core.c index c8c263875c21..a0ca63adad5a 100644 --- a/trunk/drivers/pci/hotplug/acpiphp_core.c +++ b/trunk/drivers/pci/hotplug/acpiphp_core.c @@ -91,10 +91,10 @@ static struct hotplug_slot_ops acpi_hotplug_slot_ops = { * acpiphp_register_attention - set attention LED callback * @info: must be completely filled with LED callbacks * - * Description: This is used to register a hardware specific ACPI + * Description: this is used to register a hardware specific ACPI * driver that manipulates the attention LED. All the fields in * info must be set. - */ + **/ int acpiphp_register_attention(struct acpiphp_attention_info *info) { int retval = -EINVAL; @@ -112,10 +112,10 @@ int acpiphp_register_attention(struct acpiphp_attention_info *info) * acpiphp_unregister_attention - unset attention LED callback * @info: must match the pointer used to register * - * Description: This is used to un-register a hardware specific acpi + * Description: this is used to un-register a hardware specific acpi * driver that manipulates the attention LED. The pointer to the * info struct must be the same as the one used to set it. - */ + **/ int acpiphp_unregister_attention(struct acpiphp_attention_info *info) { int retval = -EINVAL; @@ -133,6 +133,7 @@ int acpiphp_unregister_attention(struct acpiphp_attention_info *info) * @hotplug_slot: slot to enable * * Actual tasks are done in acpiphp_enable_slot() + * */ static int enable_slot(struct hotplug_slot *hotplug_slot) { @@ -150,6 +151,7 @@ static int enable_slot(struct hotplug_slot *hotplug_slot) * @hotplug_slot: slot to disable * * Actual tasks are done in acpiphp_disable_slot() + * */ static int disable_slot(struct hotplug_slot *hotplug_slot) { @@ -166,15 +168,15 @@ static int disable_slot(struct hotplug_slot *hotplug_slot) } -/** - * set_attention_status - set attention LED + /** + * set_attention_status - set attention LED * @hotplug_slot: slot to set attention LED on * @status: value to set attention LED to (0 or 1) * * attention status LED, so we use a callback that * was registered with us. This allows hardware specific * ACPI implementations to blink the light for us. - */ + **/ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status) { int retval = -ENODEV; @@ -197,6 +199,7 @@ static int disable_slot(struct hotplug_slot *hotplug_slot) * * Some platforms may not implement _STA method properly. * In that case, the value returned may not be reliable. + * */ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value) { @@ -210,7 +213,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value) } -/** + /** * get_attention_status - get attention LED status * @hotplug_slot: slot to get status from * @value: returns with value of attention LED @@ -218,8 +221,8 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value) * ACPI doesn't have known method to determine the state * of the attention status LED, so we use a callback that * was registered with us. This allows hardware specific - * ACPI implementations to determine its state. - */ + * ACPI implementations to determine its state + **/ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value) { int retval = -EINVAL; @@ -241,7 +244,8 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value) * @value: pointer to store status * * ACPI doesn't provide any formal means to access latch status. - * Instead, we fake latch status from _STA. + * Instead, we fake latch status from _STA + * */ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value) { @@ -261,7 +265,8 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value) * @value: pointer to store status * * ACPI doesn't provide any formal means to access adapter status. - * Instead, we fake adapter status from _STA. + * Instead, we fake adapter status from _STA + * */ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) { diff --git a/trunk/drivers/pci/hotplug/acpiphp_glue.c b/trunk/drivers/pci/hotplug/acpiphp_glue.c index ff1b1c71291a..1e125b56c9a9 100644 --- a/trunk/drivers/pci/hotplug/acpiphp_glue.c +++ b/trunk/drivers/pci/hotplug/acpiphp_glue.c @@ -82,6 +82,7 @@ static void handle_hotplug_event_func(acpi_handle handle, u32 type, void *contex * 2. has _PS0 method * 3. has _PS3 method * 4. .. + * */ static int is_ejectable(acpi_handle handle) { @@ -985,8 +986,10 @@ static int power_off_slot(struct acpiphp_slot *slot) /** - * acpiphp_max_busnr - return the highest reserved bus number under the given bus. + * acpiphp_max_busnr - return the highest reserved bus number under + * the given bus. * @bus: bus to start search with + * */ static unsigned char acpiphp_max_busnr(struct pci_bus *bus) { @@ -1015,6 +1018,7 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus) /** * acpiphp_bus_add - add a new bus to acpi subsystem * @func: acpiphp_func of the bridge + * */ static int acpiphp_bus_add(struct acpiphp_func *func) { @@ -1059,6 +1063,7 @@ static int acpiphp_bus_add(struct acpiphp_func *func) /** * acpiphp_bus_trim - trim a bus from acpi subsystem * @handle: handle to acpi namespace + * */ static int acpiphp_bus_trim(acpi_handle handle) { @@ -1084,6 +1089,7 @@ static int acpiphp_bus_trim(acpi_handle handle) * * This function should be called per *physical slot*, * not per each slot object in ACPI namespace. + * */ static int enable_device(struct acpiphp_slot *slot) { @@ -1179,7 +1185,6 @@ static void disable_bridges(struct pci_bus *bus) /** * disable_device - disable a slot - * @slot: ACPI PHP slot */ static int disable_device(struct acpiphp_slot *slot) { @@ -1235,15 +1240,14 @@ static int disable_device(struct acpiphp_slot *slot) /** * get_slot_status - get ACPI slot status - * @slot: ACPI PHP slot * - * If a slot has _STA for each function and if any one of them - * returned non-zero status, return it. + * if a slot has _STA for each function and if any one of them + * returned non-zero status, return it * - * If a slot doesn't have _STA and if any one of its functions' - * configuration space is configured, return 0x0f as a _STA. + * if a slot doesn't have _STA and if any one of its functions' + * configuration space is configured, return 0x0f as a _STA * - * Otherwise return 0. + * otherwise return 0 */ static unsigned int get_slot_status(struct acpiphp_slot *slot) { @@ -1277,7 +1281,6 @@ static unsigned int get_slot_status(struct acpiphp_slot *slot) /** * acpiphp_eject_slot - physically eject the slot - * @slot: ACPI PHP slot */ int acpiphp_eject_slot(struct acpiphp_slot *slot) { @@ -1311,7 +1314,6 @@ int acpiphp_eject_slot(struct acpiphp_slot *slot) /** * acpiphp_check_bridge - re-enumerate devices - * @bridge: where to begin re-enumeration * * Iterate over all slots under this bridge and make sure that if a * card is present they are enabled, and if not they are disabled. @@ -1536,11 +1538,13 @@ check_sub_bridges(acpi_handle handle, u32 lvl, void *context, void **rv) /** * handle_hotplug_event_bridge - handle ACPI event on bridges + * * @handle: Notify()'ed acpi_handle * @type: Notify code * @context: pointer to acpiphp_bridge structure * - * Handles ACPI event notification on {host,p2p} bridges. + * handles ACPI event notification on {host,p2p} bridges + * */ static void handle_hotplug_event_bridge(acpi_handle handle, u32 type, void *context) { @@ -1630,11 +1634,13 @@ static void handle_hotplug_event_bridge(acpi_handle handle, u32 type, void *cont /** * handle_hotplug_event_func - handle ACPI event on functions (i.e. slots) + * * @handle: Notify()'ed acpi_handle * @type: Notify code * @context: pointer to acpiphp_func structure * - * Handles ACPI event notification on slots. + * handles ACPI event notification on slots + * */ static void handle_hotplug_event_func(acpi_handle handle, u32 type, void *context) { @@ -1699,6 +1705,7 @@ static struct acpi_pci_driver acpi_pci_hp_driver = { /** * acpiphp_glue_init - initializes all PCI hotplug - ACPI glue data structures + * */ int __init acpiphp_glue_init(void) { @@ -1719,7 +1726,7 @@ int __init acpiphp_glue_init(void) /** * acpiphp_glue_exit - terminates all PCI hotplug - ACPI glue data structures * - * This function frees all data allocated in acpiphp_glue_init(). + * This function frees all data allocated in acpiphp_glue_init() */ void acpiphp_glue_exit(void) { @@ -1753,6 +1760,7 @@ int __init acpiphp_get_num_slots(void) * acpiphp_for_each_slot - call function for each slot * @fn: callback function * @data: context to be passed to callback function + * */ static int acpiphp_for_each_slot(acpiphp_callback fn, void *data) { @@ -1778,7 +1786,6 @@ static int acpiphp_for_each_slot(acpiphp_callback fn, void *data) /** * acpiphp_enable_slot - power on slot - * @slot: ACPI PHP slot */ int acpiphp_enable_slot(struct acpiphp_slot *slot) { @@ -1808,7 +1815,6 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot) /** * acpiphp_disable_slot - power off slot - * @slot: ACPI PHP slot */ int acpiphp_disable_slot(struct acpiphp_slot *slot) { diff --git a/trunk/drivers/pci/hotplug/acpiphp_ibm.c b/trunk/drivers/pci/hotplug/acpiphp_ibm.c index 47d26b65e99a..56829f82be4a 100644 --- a/trunk/drivers/pci/hotplug/acpiphp_ibm.c +++ b/trunk/drivers/pci/hotplug/acpiphp_ibm.c @@ -134,11 +134,11 @@ static struct acpiphp_attention_info ibm_attention_info = * ibm_slot_from_id - workaround for bad ibm hardware * @id: the slot number that linux refers to the slot by * - * Description: This method returns the aCPI slot descriptor + * Description: this method returns the aCPI slot descriptor * corresponding to the Linux slot number. This descriptor * has info about the aPCI slot id and attention status. * This descriptor must be freed using kfree when done. - */ + **/ static union apci_descriptor *ibm_slot_from_id(int id) { int ind = 0, size; @@ -173,9 +173,9 @@ static union apci_descriptor *ibm_slot_from_id(int id) * @slot: the hotplug_slot to work with * @status: what to set the LED to (0 or 1) * - * Description: This method is registered with the acpiphp module as a - * callback to do the device specific task of setting the LED status. - */ + * Description: this method is registered with the acpiphp module as a + * callback to do the device specific task of setting the LED status + **/ static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status) { union acpi_object args[2]; @@ -213,13 +213,13 @@ static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status) * @slot: the hotplug_slot to work with * @status: returns what the LED is set to (0 or 1) * - * Description: This method is registered with the acpiphp module as a - * callback to do the device specific task of getting the LED status. + * Description: this method is registered with the acpiphp module as a + * callback to do the device specific task of getting the LED status * * Because there is no direct method of getting the LED status directly * from an ACPI call, we read the aPCI table and parse out our * slot descriptor to read the status from that. - */ + **/ static int ibm_get_attention_status(struct hotplug_slot *slot, u8 *status) { union apci_descriptor *ibm_slot; @@ -245,8 +245,8 @@ static int ibm_get_attention_status(struct hotplug_slot *slot, u8 *status) * @event: the event info (device specific) * @context: passed context (our notification struct) * - * Description: This method is registered as a callback with the ACPI - * subsystem it is called when this device has an event to notify the OS of. + * Description: this method is registered as a callback with the ACPI + * subsystem it is called when this device has an event to notify the OS of * * The events actually come from the device as two events that get * synthesized into one event with data by this function. The event @@ -256,7 +256,7 @@ static int ibm_get_attention_status(struct hotplug_slot *slot, u8 *status) * From section 5.6.2.2 of the ACPI 2.0 spec, I understand that the OSPM will * only re-enable the interrupt that causes this event AFTER this method * has returned, thereby enforcing serial access for the notification struct. - */ + **/ static void ibm_handle_events(acpi_handle handle, u32 event, void *context) { u8 detail = event & 0x0f; @@ -279,16 +279,16 @@ static void ibm_handle_events(acpi_handle handle, u32 event, void *context) * ibm_get_table_from_acpi - reads the APLS buffer from ACPI * @bufp: address to pointer to allocate for the table * - * Description: This method reads the APLS buffer in from ACPI and + * Description: this method reads the APLS buffer in from ACPI and * stores the "stripped" table into a single buffer - * it allocates and passes the address back in bufp. + * it allocates and passes the address back in bufp * * If NULL is passed in as buffer, this method only calculates * the size of the table and returns that without filling - * in the buffer. + * in the buffer * - * Returns < 0 on error or the size of the table on success. - */ + * returns < 0 on error or the size of the table on success + **/ static int ibm_get_table_from_acpi(char **bufp) { union acpi_object *package; @@ -349,18 +349,17 @@ static int ibm_get_table_from_acpi(char **bufp) /** * ibm_read_apci_table - callback for the sysfs apci_table file * @kobj: the kobject this binary attribute is a part of - * @bin_attr: struct bin_attribute for this file * @buffer: the kernel space buffer to fill * @pos: the offset into the file * @size: the number of bytes requested * - * Description: Gets registered with sysfs as the reader callback - * to be executed when /sys/bus/pci/slots/apci_table gets read. + * Description: gets registered with sysfs as the reader callback + * to be executed when /sys/bus/pci/slots/apci_table gets read * * Since we don't get notified on open and close for this file, * things get really tricky here... - * our solution is to only allow reading the table in all at once. - */ + * our solution is to only allow reading the table in all at once + **/ static ssize_t ibm_read_apci_table(struct kobject *kobj, struct bin_attribute *bin_attr, char *buffer, loff_t pos, size_t size) @@ -386,10 +385,10 @@ static ssize_t ibm_read_apci_table(struct kobject *kobj, * @context: a pointer to our handle to fill when we find the device * @rv: a return value to fill if desired * - * Description: Used as a callback when calling acpi_walk_namespace + * Description: used as a callback when calling acpi_walk_namespace * to find our device. When this method returns non-zero - * acpi_walk_namespace quits its search and returns our value. - */ + * acpi_walk_namespace quits its search and returns our value + **/ static acpi_status __init ibm_find_acpi_device(acpi_handle handle, u32 lvl, void *context, void **rv) { diff --git a/trunk/drivers/pci/hotplug/cpqphp_core.c b/trunk/drivers/pci/hotplug/cpqphp_core.c index 74178875b949..a96b739b2d35 100644 --- a/trunk/drivers/pci/hotplug/cpqphp_core.c +++ b/trunk/drivers/pci/hotplug/cpqphp_core.c @@ -117,10 +117,12 @@ static inline int is_slot66mhz(struct slot *slot) /** * detect_SMBIOS_pointer - find the System Management BIOS Table in mem region. + * * @begin: begin pointer for region to be scanned. * @end: end pointer for region to be scanned. * - * Returns pointer to the head of the SMBIOS tables (or %NULL). + * Returns pointer to the head of the SMBIOS tables (or NULL) + * */ static void __iomem * detect_SMBIOS_pointer(void __iomem *begin, void __iomem *end) { @@ -155,9 +157,9 @@ static void __iomem * detect_SMBIOS_pointer(void __iomem *begin, void __iomem *e /** * init_SERR - Initializes the per slot SERR generation. - * @ctrl: controller to use * * For unexpected switch opens + * */ static int init_SERR(struct controller * ctrl) { @@ -222,15 +224,14 @@ static int pci_print_IRQ_route (void) /** * get_subsequent_smbios_entry: get the next entry from bios table. - * @smbios_start: where to start in the SMBIOS table - * @smbios_table: location of the SMBIOS table - * @curr: %NULL or pointer to previously returned structure * - * Gets the first entry if previous == NULL; - * otherwise, returns the next entry. - * Uses global SMBIOS Table pointer. + * Gets the first entry if previous == NULL + * Otherwise, returns the next entry + * Uses global SMBIOS Table pointer * - * Returns a pointer to an SMBIOS structure or NULL if none found. + * @curr: %NULL or pointer to previously returned structure + * + * returns a pointer to an SMBIOS structure or NULL if none found */ static void __iomem *get_subsequent_smbios_entry(void __iomem *smbios_start, void __iomem *smbios_table, @@ -271,18 +272,17 @@ static void __iomem *get_subsequent_smbios_entry(void __iomem *smbios_start, /** - * get_SMBIOS_entry - return the requested SMBIOS entry or %NULL - * @smbios_start: where to start in the SMBIOS table - * @smbios_table: location of the SMBIOS table - * @type: SMBIOS structure type to be returned + * get_SMBIOS_entry + * + * @type:SMBIOS structure type to be returned * @previous: %NULL or pointer to previously returned structure * - * Gets the first entry of the specified type if previous == %NULL; + * Gets the first entry of the specified type if previous == NULL * Otherwise, returns the next entry of the given type. - * Uses global SMBIOS Table pointer. - * Uses get_subsequent_smbios_entry. + * Uses global SMBIOS Table pointer + * Uses get_subsequent_smbios_entry * - * Returns a pointer to an SMBIOS structure or %NULL if none found. + * returns a pointer to an SMBIOS structure or %NULL if none found */ static void __iomem *get_SMBIOS_entry(void __iomem *smbios_start, void __iomem *smbios_table, @@ -581,9 +581,7 @@ get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot) /** * cpqhp_set_attention_status - Turns the Amber LED for a slot on or off - * @ctrl: struct controller to use - * @func: PCI device/function info - * @status: LED control flag: 1 = LED on, 0 = LED off + * */ static int cpqhp_set_attention_status(struct controller *ctrl, struct pci_func *func, @@ -623,8 +621,7 @@ cpqhp_set_attention_status(struct controller *ctrl, struct pci_func *func, /** * set_attention_status - Turns the Amber LED for a slot on or off - * @hotplug_slot: slot to change LED on - * @status: LED control flag + * */ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status) { diff --git a/trunk/drivers/pci/hotplug/cpqphp_ctrl.c b/trunk/drivers/pci/hotplug/cpqphp_ctrl.c index 4018420c6f95..856d57b4d604 100644 --- a/trunk/drivers/pci/hotplug/cpqphp_ctrl.c +++ b/trunk/drivers/pci/hotplug/cpqphp_ctrl.c @@ -123,7 +123,7 @@ static u8 handle_switch_change(u8 change, struct controller * ctrl) } /** - * cpqhp_find_slot - find the struct slot of given device + * cpqhp_find_slot: find the struct slot of given device * @ctrl: scan lots of this controller * @device: the device id to find */ @@ -305,8 +305,9 @@ static u8 handle_power_fault(u8 change, struct controller * ctrl) /** - * sort_by_size - sort nodes on the list by their length, smallest first. + * sort_by_size: sort nodes on the list by their length, smallest first. * @head: list to sort + * */ static int sort_by_size(struct pci_resource **head) { @@ -353,8 +354,9 @@ static int sort_by_size(struct pci_resource **head) /** - * sort_by_max_size - sort nodes on the list by their length, largest first. + * sort_by_max_size: sort nodes on the list by their length, largest first. * @head: list to sort + * */ static int sort_by_max_size(struct pci_resource **head) { @@ -401,10 +403,8 @@ static int sort_by_max_size(struct pci_resource **head) /** - * do_pre_bridge_resource_split - find node of resources that are unused - * @head: new list head - * @orig_head: original list head - * @alignment: max node size (?) + * do_pre_bridge_resource_split: find node of resources that are unused + * */ static struct pci_resource *do_pre_bridge_resource_split(struct pci_resource **head, struct pci_resource **orig_head, u32 alignment) @@ -477,9 +477,8 @@ static struct pci_resource *do_pre_bridge_resource_split(struct pci_resource **h /** - * do_bridge_resource_split - find one node of resources that aren't in use - * @head: list head - * @alignment: max node size (?) + * do_bridge_resource_split: find one node of resources that aren't in use + * */ static struct pci_resource *do_bridge_resource_split(struct pci_resource **head, u32 alignment) { @@ -526,13 +525,14 @@ static struct pci_resource *do_bridge_resource_split(struct pci_resource **head, /** - * get_io_resource - find first node of given size not in ISA aliasing window. + * get_io_resource: find first node of given size not in ISA aliasing window. * @head: list to search * @size: size of node to find, must be a power of two. * - * Description: This function sorts the resource list by size and then returns + * Description: this function sorts the resource list by size and then returns * returns the first node of "size" length that is not in the ISA aliasing * window. If it finds a node larger than "size" it will split it up. + * */ static struct pci_resource *get_io_resource(struct pci_resource **head, u32 size) { @@ -620,7 +620,7 @@ static struct pci_resource *get_io_resource(struct pci_resource **head, u32 size /** - * get_max_resource - get largest node which has at least the given size. + * get_max_resource: get largest node which has at least the given size. * @head: the list to search the node in * @size: the minimum size of the node to find * @@ -712,7 +712,7 @@ static struct pci_resource *get_max_resource(struct pci_resource **head, u32 siz /** - * get_resource - find resource of given size and split up larger ones. + * get_resource: find resource of given size and split up larger ones. * @head: the list to search for resources * @size: the size limit to use * @@ -804,14 +804,14 @@ static struct pci_resource *get_resource(struct pci_resource **head, u32 size) /** - * cpqhp_resource_sort_and_combine - sort nodes by base addresses and clean up + * cpqhp_resource_sort_and_combine: sort nodes by base addresses and clean up. * @head: the list to sort and clean up * * Description: Sorts all of the nodes in the list in ascending order by * their base addresses. Also does garbage collection by * combining adjacent nodes. * - * Returns %0 if success. + * returns 0 if success */ int cpqhp_resource_sort_and_combine(struct pci_resource **head) { @@ -951,9 +951,9 @@ irqreturn_t cpqhp_ctrl_intr(int IRQ, void *data) /** * cpqhp_slot_create - Creates a node and adds it to the proper bus. - * @busnumber: bus where new node is to be located + * @busnumber - bus where new node is to be located * - * Returns pointer to the new node or %NULL if unsuccessful. + * Returns pointer to the new node or NULL if unsuccessful */ struct pci_func *cpqhp_slot_create(u8 busnumber) { @@ -986,7 +986,7 @@ struct pci_func *cpqhp_slot_create(u8 busnumber) * slot_remove - Removes a node from the linked list of slots. * @old_slot: slot to remove * - * Returns %0 if successful, !0 otherwise. + * Returns 0 if successful, !0 otherwise. */ static int slot_remove(struct pci_func * old_slot) { @@ -1026,7 +1026,7 @@ static int slot_remove(struct pci_func * old_slot) * bridge_slot_remove - Removes a node from the linked list of slots. * @bridge: bridge to remove * - * Returns %0 if successful, !0 otherwise. + * Returns 0 if successful, !0 otherwise. */ static int bridge_slot_remove(struct pci_func *bridge) { @@ -1071,7 +1071,7 @@ static int bridge_slot_remove(struct pci_func *bridge) * cpqhp_slot_find - Looks for a node by bus, and device, multiple functions accessed * @bus: bus to find * @device: device to find - * @index: is %0 for first function found, %1 for the second... + * @index: is 0 for first function found, 1 for the second... * * Returns pointer to the node if successful, %NULL otherwise. */ @@ -1115,13 +1115,16 @@ static int is_bridge(struct pci_func * func) /** - * set_controller_speed - set the frequency and/or mode of a specific controller segment. + * set_controller_speed - set the frequency and/or mode of a specific + * controller segment. + * * @ctrl: controller to change frequency/mode for. * @adapter_speed: the speed of the adapter we want to match. * @hp_slot: the slot number where the adapter is installed. * - * Returns %0 if we successfully change frequency and/or mode to match the + * Returns 0 if we successfully change frequency and/or mode to match the * adapter speed. + * */ static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_slot) { @@ -1250,14 +1253,13 @@ static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_ /** * board_replaced - Called after a board has been replaced in the system. - * @func: PCI device/function information - * @ctrl: hotplug controller * - * This is only used if we don't have resources for hot add. - * Turns power on for the board. - * Checks to see if board is the same. - * If board is same, reconfigures it. + * This is only used if we don't have resources for hot add + * Turns power on for the board + * Checks to see if board is the same + * If board is same, reconfigures it * If board isn't same, turns it back off. + * */ static u32 board_replaced(struct pci_func *func, struct controller *ctrl) { @@ -1401,11 +1403,10 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl) /** * board_added - Called after a board has been added to the system. - * @func: PCI device/function info - * @ctrl: hotplug controller * - * Turns power on for the board. - * Configures board. + * Turns power on for the board + * Configures board + * */ static u32 board_added(struct pci_func *func, struct controller *ctrl) { @@ -1606,10 +1607,8 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl) /** - * remove_board - Turns off slot and LEDs - * @func: PCI device/function info - * @replace_flag: whether replacing or adding a new device - * @ctrl: target controller + * remove_board - Turns off slot and LED's + * */ static u32 remove_board(struct pci_func * func, u32 replace_flag, struct controller * ctrl) { @@ -1903,11 +1902,11 @@ static void interrupt_event_handler(struct controller *ctrl) /** - * cpqhp_pushbutton_thread - handle pushbutton events - * @slot: target slot (struct) + * cpqhp_pushbutton_thread * - * Scheduled procedure to handle blocking stuff for the pushbuttons. + * Scheduled procedure to handle blocking stuff for the pushbuttons * Handles all pending events and exits. + * */ void cpqhp_pushbutton_thread(unsigned long slot) { @@ -2138,10 +2137,9 @@ int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func) } /** - * switch_leds - switch the leds, go from one site to the other. + * switch_leds: switch the leds, go from one site to the other. * @ctrl: controller to use * @num_of_slots: number of slots to use - * @work_LED: LED control value * @direction: 1 to start from the left side, 0 to start right. */ static void switch_leds(struct controller *ctrl, const int num_of_slots, @@ -2167,11 +2165,11 @@ static void switch_leds(struct controller *ctrl, const int num_of_slots, } /** - * cpqhp_hardware_test - runs hardware tests - * @ctrl: target controller - * @test_num: the number written to the "test" file in sysfs. + * hardware_test - runs hardware tests * * For hot plug ctrl folks to play with. + * test_num is the number written to the "test" file in sysfs + * */ int cpqhp_hardware_test(struct controller *ctrl, int test_num) { @@ -2251,12 +2249,14 @@ int cpqhp_hardware_test(struct controller *ctrl, int test_num) /** * configure_new_device - Configures the PCI header information of one board. + * * @ctrl: pointer to controller structure * @func: pointer to function structure * @behind_bridge: 1 if this is a recursive call, 0 if not * @resources: pointer to set of resource lists * - * Returns 0 if success. + * Returns 0 if success + * */ static u32 configure_new_device(struct controller * ctrl, struct pci_func * func, u8 behind_bridge, struct resource_lists * resources) @@ -2346,13 +2346,15 @@ static u32 configure_new_device(struct controller * ctrl, struct pci_func * func /** * configure_new_function - Configures the PCI header information of one device + * * @ctrl: pointer to controller structure * @func: pointer to function structure * @behind_bridge: 1 if this is a recursive call, 0 if not * @resources: pointer to set of resource lists * * Calls itself recursively for bridged devices. - * Returns 0 if success. + * Returns 0 if success + * */ static int configure_new_function(struct controller *ctrl, struct pci_func *func, u8 behind_bridge, diff --git a/trunk/drivers/pci/hotplug/fakephp.c b/trunk/drivers/pci/hotplug/fakephp.c index d7a293e3faf5..027f6865d7e3 100644 --- a/trunk/drivers/pci/hotplug/fakephp.c +++ b/trunk/drivers/pci/hotplug/fakephp.c @@ -165,11 +165,11 @@ static void remove_slot(struct dummy_slot *dslot) } /** - * pci_rescan_slot - Rescan slot - * @temp: Device template. Should be set: bus and devfn. + * Rescan slot. + * Tries hard not to re-enable already existing devices + * also handles scanning of subfunctions * - * Tries hard not to re-enable already existing devices; - * also handles scanning of subfunctions. + * @param temp Device template. Should be set: bus and devfn. */ static void pci_rescan_slot(struct pci_dev *temp) { @@ -229,10 +229,10 @@ static void pci_rescan_slot(struct pci_dev *temp) /** - * pci_rescan_bus - Rescan PCI bus - * @bus: the PCI bus to rescan + * Rescan PCI bus. + * call pci_rescan_slot for each possible function of the bus * - * Call pci_rescan_slot for each possible function of the bus. + * @param bus */ static void pci_rescan_bus(const struct pci_bus *bus) { diff --git a/trunk/drivers/pci/hotplug/pciehp_ctrl.c b/trunk/drivers/pci/hotplug/pciehp_ctrl.c index f1e0966cee95..c8cb49c5a752 100644 --- a/trunk/drivers/pci/hotplug/pciehp_ctrl.c +++ b/trunk/drivers/pci/hotplug/pciehp_ctrl.c @@ -208,10 +208,10 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot) /** * board_added - Called after a board has been added to the system. - * @p_slot: &slot where board is added * - * Turns power on for the board. - * Configures board. + * Turns power on for the board + * Configures board + * */ static int board_added(struct slot *p_slot) { @@ -276,8 +276,8 @@ static int board_added(struct slot *p_slot) } /** - * remove_board - Turns off slot and LEDs - * @p_slot: slot where board is being removed + * remove_board - Turns off slot and LED's + * */ static int remove_board(struct slot *p_slot) { @@ -319,11 +319,11 @@ struct power_work_info { }; /** - * pciehp_power_thread - handle pushbutton events - * @work: &struct work_struct describing work to be done + * pciehp_pushbutton_thread * - * Scheduled procedure to handle blocking stuff for the pushbuttons. + * Scheduled procedure to handle blocking stuff for the pushbuttons * Handles all pending events and exits. + * */ static void pciehp_power_thread(struct work_struct *work) { diff --git a/trunk/drivers/pci/hotplug/rpadlpar_core.c b/trunk/drivers/pci/hotplug/rpadlpar_core.c index b169b0e2647f..deb6b5e35feb 100644 --- a/trunk/drivers/pci/hotplug/rpadlpar_core.c +++ b/trunk/drivers/pci/hotplug/rpadlpar_core.c @@ -100,7 +100,6 @@ static struct device_node *find_dlpar_node(char *drc_name, int *node_type) /** * find_php_slot - return hotplug slot structure for device node - * @dn: target &device_node * * This routine will return the hotplug slot structure * for a given device node. Note that built-in PCI slots @@ -294,8 +293,9 @@ static int dlpar_add_vio_slot(char *drc_name, struct device_node *dn) * dlpar_add_slot - DLPAR add an I/O Slot * @drc_name: drc-name of newly added slot * - * Make the hotplug module and the kernel aware of a newly added I/O Slot. - * Return Codes: + * Make the hotplug module and the kernel aware + * of a newly added I/O Slot. + * Return Codes - * 0 Success * -ENODEV Not a valid drc_name * -EINVAL Slot already added @@ -339,9 +339,9 @@ int dlpar_add_slot(char *drc_name) /** * dlpar_remove_vio_slot - DLPAR remove a virtual I/O Slot * @drc_name: drc-name of newly added slot - * @dn: &device_node * - * Remove the kernel and hotplug representations of an I/O Slot. + * Remove the kernel and hotplug representations + * of an I/O Slot. * Return Codes: * 0 Success * -EINVAL Vio dev doesn't exist @@ -359,11 +359,11 @@ static int dlpar_remove_vio_slot(char *drc_name, struct device_node *dn) } /** - * dlpar_remove_pci_slot - DLPAR remove a PCI I/O Slot + * dlpar_remove_slot - DLPAR remove a PCI I/O Slot * @drc_name: drc-name of newly added slot - * @dn: &device_node * - * Remove the kernel and hotplug representations of a PCI I/O Slot. + * Remove the kernel and hotplug representations + * of a PCI I/O Slot. * Return Codes: * 0 Success * -ENODEV Not a valid drc_name @@ -405,7 +405,8 @@ int dlpar_remove_pci_slot(char *drc_name, struct device_node *dn) * dlpar_remove_slot - DLPAR remove an I/O Slot * @drc_name: drc-name of newly added slot * - * Remove the kernel and hotplug representations of an I/O Slot. + * Remove the kernel and hotplug representations + * of an I/O Slot. * Return Codes: * 0 Success * -ENODEV Not a valid drc_name diff --git a/trunk/drivers/pci/hotplug/rpaphp_core.c b/trunk/drivers/pci/hotplug/rpaphp_core.c index 58f1a9927709..458c08ef2654 100644 --- a/trunk/drivers/pci/hotplug/rpaphp_core.c +++ b/trunk/drivers/pci/hotplug/rpaphp_core.c @@ -54,12 +54,10 @@ module_param(debug, bool, 0644); /** * set_attention_status - set attention LED - * @hotplug_slot: target &hotplug_slot - * @value: LED control value - * * echo 0 > attention -- set LED OFF * echo 1 > attention -- set LED ON * echo 2 > attention -- set LED ID(identify, light is blinking) + * */ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value) { @@ -101,8 +99,6 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) /** * get_attention_status - get attention LED status - * @hotplug_slot: slot to get status - * @value: pointer to store status */ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value) { @@ -258,11 +254,6 @@ static int is_php_type(char *drc_type) /** * is_php_dn() - return 1 if this is a hotpluggable pci slot, else 0 - * @dn: target &device_node - * @indexes: passed to get_children_props() - * @names: passed to get_children_props() - * @types: returned from get_children_props() - * @power_domains: * * This routine will return true only if the device node is * a hotpluggable slot. This routine will return false @@ -288,7 +279,7 @@ static int is_php_dn(struct device_node *dn, const int **indexes, /** * rpaphp_add_slot -- declare a hotplug slot to the hotplug subsystem. - * @dn: device node of slot + * @dn device node of slot * * This subroutine will register a hotplugable slot with the * PCI hotplug infrastructure. This routine is typicaly called @@ -300,7 +291,7 @@ static int is_php_dn(struct device_node *dn, const int **indexes, * routine will just return without doing anything, since embedded * slots cannot be hotplugged. * - * To remove a slot, it suffices to call rpaphp_deregister_slot(). + * To remove a slot, it suffices to call rpaphp_deregister_slot() */ int rpaphp_add_slot(struct device_node *dn) { diff --git a/trunk/drivers/pci/hotplug/rpaphp_pci.c b/trunk/drivers/pci/hotplug/rpaphp_pci.c index 0de84533cd80..54ca8650d511 100644 --- a/trunk/drivers/pci/hotplug/rpaphp_pci.c +++ b/trunk/drivers/pci/hotplug/rpaphp_pci.c @@ -79,7 +79,6 @@ static void set_slot_name(struct slot *slot) /** * rpaphp_enable_slot - record slot state, config pci device - * @slot: target &slot * * Initialize values in the slot, and the hotplug_slot info * structures to indicate if there is a pci card plugged into diff --git a/trunk/drivers/pci/hotplug/shpchp_ctrl.c b/trunk/drivers/pci/hotplug/shpchp_ctrl.c index eb5cac6f08ae..d2fc35598cdd 100644 --- a/trunk/drivers/pci/hotplug/shpchp_ctrl.c +++ b/trunk/drivers/pci/hotplug/shpchp_ctrl.c @@ -231,10 +231,10 @@ static int fix_bus_speed(struct controller *ctrl, struct slot *pslot, /** * board_added - Called after a board has been added to the system. - * @p_slot: target &slot * - * Turns power on for the board. - * Configures board. + * Turns power on for the board + * Configures board + * */ static int board_added(struct slot *p_slot) { @@ -350,8 +350,8 @@ static int board_added(struct slot *p_slot) /** - * remove_board - Turns off slot and LEDs - * @p_slot: target &slot + * remove_board - Turns off slot and LED's + * */ static int remove_board(struct slot *p_slot) { @@ -397,11 +397,11 @@ struct pushbutton_work_info { }; /** - * shpchp_pushbutton_thread - handle pushbutton events - * @work: &struct work_struct to be handled + * shpchp_pushbutton_thread * - * Scheduled procedure to handle blocking stuff for the pushbuttons. + * Scheduled procedure to handle blocking stuff for the pushbuttons * Handles all pending events and exits. + * */ static void shpchp_pushbutton_thread(struct work_struct *work) { diff --git a/trunk/drivers/pci/pci-sysfs.c b/trunk/drivers/pci/pci-sysfs.c index 7d1877341aad..1b7b2812bf2d 100644 --- a/trunk/drivers/pci/pci-sysfs.c +++ b/trunk/drivers/pci/pci-sysfs.c @@ -702,10 +702,8 @@ static int __init pci_sysfs_init(void) sysfs_initialized = 1; for_each_pci_dev(pdev) { retval = pci_create_sysfs_dev_files(pdev); - if (retval) { - pci_dev_put(pdev); + if (retval) return retval; - } } return 0; diff --git a/trunk/drivers/pci/pcie/aer/aerdrv_core.c b/trunk/drivers/pci/pcie/aer/aerdrv_core.c index 3c0d8d138f5a..92a8469b21ba 100644 --- a/trunk/drivers/pci/pcie/aer/aerdrv_core.c +++ b/trunk/drivers/pci/pcie/aer/aerdrv_core.c @@ -168,11 +168,11 @@ static int find_device_iter(struct device *device, void *data) /** * find_source_device - search through device hierarchy for source device - * @parent: pointer to Root Port pci_dev data structure + * @p_dev: pointer to Root Port pci_dev data structure * @id: device ID of agent who sends an error message to this Root Port * * Invoked when error is detected at the Root Port. - */ + **/ static struct device* find_source_device(struct pci_dev *parent, u16 id) { struct pci_dev *dev = parent; @@ -286,15 +286,14 @@ static void report_resume(struct pci_dev *dev, void *data) /** * broadcast_error_message - handle message broadcast to downstream drivers - * @dev: pointer to from where in a hierarchy message is broadcasted down + * @device: pointer to from where in a hierarchy message is broadcasted down + * @api: callback to be broadcasted * @state: error state - * @error_mesg: message to print - * @cb: callback to be broadcasted * * Invoked during error recovery process. Once being invoked, the content * of error severity will be broadcasted to all downstream drivers in a * hierarchy in question. - */ + **/ static pci_ers_result_t broadcast_error_message(struct pci_dev *dev, enum pci_channel_state state, char *error_mesg, @@ -429,7 +428,7 @@ static pci_ers_result_t reset_link(struct pcie_device *aerdev, * Invoked when an error is nonfatal/fatal. Once being invoked, broadcast * error detected message to all downstream drivers within a hierarchy in * question and return the returned code. - */ + **/ static pci_ers_result_t do_recovery(struct pcie_device *aerdev, struct pci_dev *dev, int severity) @@ -489,7 +488,7 @@ static pci_ers_result_t do_recovery(struct pcie_device *aerdev, * @info: comprehensive error information * * Invoked when an error being detected by Root Port. - */ + **/ static void handle_error_source(struct pcie_device * aerdev, struct pci_dev *dev, struct aer_err_info info) @@ -522,7 +521,7 @@ static void handle_error_source(struct pcie_device * aerdev, * @rpc: pointer to a Root Port data structure * * Invoked when PCIE bus loads AER service driver. - */ + **/ void aer_enable_rootport(struct aer_rpc *rpc) { struct pci_dev *pdev = rpc->rpd->port; @@ -570,7 +569,7 @@ void aer_enable_rootport(struct aer_rpc *rpc) * @rpc: pointer to a Root Port data structure * * Invoked when PCIE bus unloads AER service driver. - */ + **/ static void disable_root_aer(struct aer_rpc *rpc) { struct pci_dev *pdev = rpc->rpd->port; @@ -591,7 +590,7 @@ static void disable_root_aer(struct aer_rpc *rpc) * @rpc: pointer to the root port which holds an error * * Invoked by DPC handler to consume an error. - */ + **/ static struct aer_err_source* get_e_source(struct aer_rpc *rpc) { struct aer_err_source *e_source; @@ -656,7 +655,7 @@ static int get_device_error_info(struct pci_dev *dev, struct aer_err_info *info) * aer_isr_one_error - consume an error detected by root port * @p_device: pointer to error root port service device * @e_src: pointer to an error source - */ + **/ static void aer_isr_one_error(struct pcie_device *p_device, struct aer_err_source *e_src) { @@ -707,7 +706,7 @@ static void aer_isr_one_error(struct pcie_device *p_device, * @work: definition of this work item * * Invoked, as DPC, when root port records new detected error - */ + **/ void aer_isr(struct work_struct *work) { struct aer_rpc *rpc = container_of(work, struct aer_rpc, dpc_handler); @@ -730,7 +729,7 @@ void aer_isr(struct work_struct *work) * @rpc: pointer to a root port device being deleted * * Invoked when AER service unloaded on a specific Root Port - */ + **/ void aer_delete_rootport(struct aer_rpc *rpc) { /* Disable root port AER itself */ @@ -744,7 +743,7 @@ void aer_delete_rootport(struct aer_rpc *rpc) * @dev: pointer to AER pcie device * * Invoked when AER service driver is loaded. - */ + **/ int aer_init(struct pcie_device *dev) { if (aer_osc_setup(dev) && !forceload) diff --git a/trunk/drivers/pci/pcie/portdrv_pci.c b/trunk/drivers/pci/pcie/portdrv_pci.c index 26057f98f72e..df383645e366 100644 --- a/trunk/drivers/pci/pcie/portdrv_pci.c +++ b/trunk/drivers/pci/pcie/portdrv_pci.c @@ -217,7 +217,7 @@ static int slot_reset_iter(struct device *device, void *data) static pci_ers_result_t pcie_portdrv_slot_reset(struct pci_dev *dev) { - pci_ers_result_t status = PCI_ERS_RESULT_NONE; + pci_ers_result_t status; int retval; /* If fatal, restore cfg space for possible link reset at upstream */ diff --git a/trunk/drivers/usb/host/Kconfig b/trunk/drivers/usb/host/Kconfig index 177e78ed241b..49a91c5ee51b 100644 --- a/trunk/drivers/usb/host/Kconfig +++ b/trunk/drivers/usb/host/Kconfig @@ -156,7 +156,7 @@ config USB_OHCI_HCD_PCI config USB_OHCI_HCD_SSB bool "OHCI support for Broadcom SSB OHCI core" - depends on USB_OHCI_HCD && (SSB = y || SSB = CONFIG_USB_OHCI_HCD) && EXPERIMENTAL + depends on USB_OHCI_HCD && (SSB = y || SSB = USB_OHCI_HCD) && EXPERIMENTAL default n ---help--- Support for the Sonics Silicon Backplane (SSB) attached diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index 282240afe99e..4ccaaa4b13b2 100644 --- a/trunk/fs/exec.c +++ b/trunk/fs/exec.c @@ -1780,12 +1780,6 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs) but keep the previous behaviour for now. */ if (!ispipe && !S_ISREG(inode->i_mode)) goto close_fail; - /* - * Dont allow local users get cute and trick others to coredump - * into their pre-created files: - */ - if (inode->i_uid != current->fsuid) - goto close_fail; if (!file->f_op) goto close_fail; if (!file->f_op->write) diff --git a/trunk/fs/sysfs/file.c b/trunk/fs/sysfs/file.c index 4045bdcc4b33..27d1785b7644 100644 --- a/trunk/fs/sysfs/file.c +++ b/trunk/fs/sysfs/file.c @@ -119,11 +119,7 @@ static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer sysfs_put_active_two(attr_sd); - /* - * The code works fine with PAGE_SIZE return but it's likely to - * indicate truncated result or overflow in normal use cases. - */ - BUG_ON(count >= (ssize_t)PAGE_SIZE); + BUG_ON(count > (ssize_t)PAGE_SIZE); if (count >= 0) { buffer->needs_read_fill = 0; buffer->count = count; diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index ac3d496fbd20..ee800e7a70de 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -282,10 +282,6 @@ static inline void touch_all_softlockup_watchdogs(void) /* Attach to any functions which should be ignored in wchan output. */ #define __sched __attribute__((__section__(".sched.text"))) - -/* Linker adds these: start and end of __sched functions */ -extern char __sched_text_start[], __sched_text_end[]; - /* Is this address in the __sched functions? */ extern int in_sched_functions(unsigned long addr); diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 98dcdf272db3..38933cafea8a 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -5466,7 +5466,7 @@ sd_alloc_ctl_domain_table(struct sched_domain *sd) return table; } -static ctl_table *sd_alloc_ctl_cpu_table(int cpu) +static ctl_table * sd_alloc_ctl_cpu_table(int cpu) { struct ctl_table *entry, *table; struct sched_domain *sd; @@ -6708,6 +6708,9 @@ void __init sched_init_smp(void) int in_sched_functions(unsigned long addr) { + /* Linker adds these: start and end of __sched functions */ + extern char __sched_text_start[], __sched_text_end[]; + return in_lock_functions(addr) || (addr >= (unsigned long)__sched_text_start && addr < (unsigned long)__sched_text_end); diff --git a/trunk/kernel/sched_debug.c b/trunk/kernel/sched_debug.c index d30467b47ddd..5d0d623a5465 100644 --- a/trunk/kernel/sched_debug.c +++ b/trunk/kernel/sched_debug.c @@ -327,12 +327,10 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) avg_atom = -1LL; avg_per_cpu = p->se.sum_exec_runtime; - if (p->se.nr_migrations) { - avg_per_cpu = div64_64(avg_per_cpu, - p->se.nr_migrations); - } else { + if (p->se.nr_migrations) + avg_per_cpu = div64_64(avg_per_cpu, p->se.nr_migrations); + else avg_per_cpu = -1LL; - } __PN(avg_atom); __PN(avg_per_cpu); diff --git a/trunk/kernel/sched_stats.h b/trunk/kernel/sched_stats.h index 5b32433e7ee5..630178e53bb6 100644 --- a/trunk/kernel/sched_stats.h +++ b/trunk/kernel/sched_stats.h @@ -52,8 +52,7 @@ static int show_schedstat(struct seq_file *seq, void *v) sd->lb_nobusyq[itype], sd->lb_nobusyg[itype]); } - seq_printf(seq, - " %u %u %u %u %u %u %u %u %u %u %u %u\n", + seq_printf(seq, " %u %u %u %u %u %u %u %u %u %u %u %u\n", sd->alb_count, sd->alb_failed, sd->alb_pushed, sd->sbe_count, sd->sbe_balanced, sd->sbe_pushed, sd->sbf_count, sd->sbf_balanced, sd->sbf_pushed, diff --git a/trunk/kernel/time/tick-sched.c b/trunk/kernel/time/tick-sched.c index cb89fa8db110..27a2338deb4a 100644 --- a/trunk/kernel/time/tick-sched.c +++ b/trunk/kernel/time/tick-sched.c @@ -133,8 +133,6 @@ void tick_nohz_update_jiffies(void) if (!ts->tick_stopped) return; - touch_softlockup_watchdog(); - cpu_clear(cpu, nohz_cpu_mask); now = ktime_get(); diff --git a/trunk/lib/kobject.c b/trunk/lib/kobject.c index b52e9f4ef371..a7e3bf4d3c70 100644 --- a/trunk/lib/kobject.c +++ b/trunk/lib/kobject.c @@ -313,8 +313,8 @@ int kobject_rename(struct kobject * kobj, const char *new_name) struct kobject *temp_kobj; temp_kobj = kset_find_obj(kobj->kset, new_name); if (temp_kobj) { - printk(KERN_WARNING "kobject '%s' cannot be renamed " - "to '%s' as '%s' is already in existence.\n", + printk(KERN_WARNING "kobject '%s' can not be renamed " + "to '%s' as '%s' is already in existance.\n", kobject_name(kobj), new_name, new_name); kobject_put(temp_kobj); return -EINVAL; diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index 4ffed1cd158b..12376ae3f733 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -305,6 +305,7 @@ static inline void prep_zero_page(struct page *page, int order, gfp_t gfp_flags) { int i; + VM_BUG_ON((gfp_flags & (__GFP_WAIT | __GFP_HIGHMEM)) == __GFP_HIGHMEM); /* * clear_highpage() will use KM_USER0, so it's a bug to use __GFP_ZERO * and __GFP_HIGHMEM from hard or soft interrupt context. diff --git a/trunk/mm/shmem.c b/trunk/mm/shmem.c index 51b3d6ccddab..253d205914ba 100644 --- a/trunk/mm/shmem.c +++ b/trunk/mm/shmem.c @@ -1072,7 +1072,7 @@ shmem_alloc_page(gfp_t gfp, struct shmem_inode_info *info, pvma.vm_policy = mpol_shared_policy_lookup(&info->policy, idx); pvma.vm_pgoff = idx; pvma.vm_end = PAGE_SIZE; - page = alloc_page_vma(gfp, &pvma, 0); + page = alloc_page_vma(gfp | __GFP_ZERO, &pvma, 0); mpol_free(pvma.vm_policy); return page; } @@ -1093,7 +1093,7 @@ shmem_swapin(struct shmem_inode_info *info,swp_entry_t entry,unsigned long idx) static inline struct page * shmem_alloc_page(gfp_t gfp,struct shmem_inode_info *info, unsigned long idx) { - return alloc_page(gfp); + return alloc_page(gfp | __GFP_ZERO); } #endif @@ -1306,7 +1306,6 @@ static int shmem_getpage(struct inode *inode, unsigned long idx, info->alloced++; spin_unlock(&info->lock); - clear_highpage(filepage); flush_dcache_page(filepage); SetPageUptodate(filepage); }