All of lore.kernel.org
 help / color / mirror / Atom feed
From: helgaas@ldl.fc.hp.com
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jaroslav Kysela <perex@suse.cz>, Adam Belay <ambx1@neo.rr.com>,
	linux-acpi@vger.kernel.org
Subject: [patch 02/17] PNP: Lindent core.c
Date: Mon, 23 Jul 2007 15:27:59 -0600	[thread overview]
Message-ID: <20070723213240.751349035@ldl.fc.hp.com> (raw)
In-Reply-To: 20070723212757.122218147@ldl.fc.hp.com

[-- Attachment #1: pnp-format-core --]
[-- Type: text/plain, Size: 3481 bytes --]

Run through Lindent, no functional change.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

Index: work2/drivers/pnp/core.c
===================================================================
--- work2.orig/drivers/pnp/core.c	2007-07-23 14:57:12.000000000 -0600
+++ work2/drivers/pnp/core.c	2007-07-23 15:03:39.000000000 -0600
@@ -2,7 +2,6 @@
  * core.c - contains all core device and protocol registration functions
  *
  * Copyright 2002 Adam Belay <ambx1@neo.rr.com>
- *
  */
 
 #include <linux/pnp.h>
@@ -18,7 +17,6 @@
 
 #include "base.h"
 
-
 static LIST_HEAD(pnp_protocols);
 LIST_HEAD(pnp_global);
 DEFINE_SPINLOCK(pnp_lock);
@@ -36,7 +34,7 @@
 	void *result;
 
 	result = kzalloc(size, GFP_KERNEL);
-	if (!result){
+	if (!result) {
 		printk(KERN_ERR "pnp: Out of Memory\n");
 		return NULL;
 	}
@@ -49,11 +47,10 @@
  *
  *  Ex protocols: ISAPNP, PNPBIOS, etc
  */
-
 int pnp_register_protocol(struct pnp_protocol *protocol)
 {
 	int nodenum;
-	struct list_head * pos;
+	struct list_head *pos;
 
 	if (!protocol)
 		return -EINVAL;
@@ -64,9 +61,9 @@
 	spin_lock(&pnp_lock);
 
 	/* assign the lowest unused number */
-	list_for_each(pos,&pnp_protocols) {
-		struct pnp_protocol * cur = to_pnp_protocol(pos);
-		if (cur->number == nodenum){
+	list_for_each(pos, &pnp_protocols) {
+		struct pnp_protocol *cur = to_pnp_protocol(pos);
+		if (cur->number == nodenum) {
 			pos = &pnp_protocols;
 			nodenum++;
 		}
@@ -83,7 +80,6 @@
 /**
  * pnp_protocol_unregister - removes a pnp protocol from the pnp layer
  * @protocol: pointer to the corresponding pnp_protocol structure
- *
  */
 void pnp_unregister_protocol(struct pnp_protocol *protocol)
 {
@@ -93,11 +89,11 @@
 	device_unregister(&protocol->dev);
 }
 
-
 static void pnp_free_ids(struct pnp_dev *dev)
 {
-	struct pnp_id * id;
-	struct pnp_id * next;
+	struct pnp_id *id;
+	struct pnp_id *next;
+
 	if (!dev)
 		return;
 	id = dev->id;
@@ -110,7 +106,8 @@
 
 static void pnp_release_device(struct device *dmdev)
 {
-	struct pnp_dev * dev = to_pnp_dev(dmdev);
+	struct pnp_dev *dev = to_pnp_dev(dmdev);
+
 	pnp_free_option(dev->independent);
 	pnp_free_option(dev->dependent);
 	pnp_free_ids(dev);
@@ -120,6 +117,7 @@
 int __pnp_add_device(struct pnp_dev *dev)
 {
 	int ret;
+
 	pnp_fixup_device(dev);
 	dev->dev.bus = &pnp_bus_type;
 	dev->dev.dma_mask = &dev->dma_mask;
@@ -143,13 +141,13 @@
  *
  *  adds to driver model, name database, fixups, interface, etc.
  */
-
 int pnp_add_device(struct pnp_dev *dev)
 {
 	if (!dev || !dev->protocol || dev->card)
 		return -EINVAL;
 	dev->dev.parent = &dev->protocol->dev;
-	sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number, dev->number);
+	sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number,
+		dev->number);
 	return __pnp_add_device(dev);
 }
 
@@ -162,21 +160,6 @@
 	device_unregister(&dev->dev);
 }
 
-/**
- * pnp_remove_device - removes a pnp device from the pnp layer
- * @dev: pointer to dev to add
- *
- * 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)
 {
 	printk(KERN_INFO "Linux Plug and Play Support v0.97 (c) Adam Belay\n");
@@ -184,10 +167,3 @@
 }
 
 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  */

--

  parent reply	other threads:[~2007-07-23 21:33 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-23 21:27 [patch 00/17] PNP Lindent helgaas
2007-07-23 21:27 ` [patch 01/17] PNP: Lindent card.c helgaas
2007-07-23 21:27 ` helgaas [this message]
2007-07-23 21:28 ` [patch 03/17] PNP: Lindent driver.c helgaas
2007-07-23 21:28 ` [patch 04/17] PNP: Lindent interface.c helgaas
2007-07-23 21:28 ` [patch 05/17] PNP: Lindent manager.c helgaas
2007-07-23 21:28 ` [patch 06/17] PNP: Lindent quirks.c helgaas
2007-07-23 21:28 ` [patch 07/17] PNP: Lindent resource.c helgaas
2007-07-23 21:28 ` [patch 08/17] PNP: Lindent support.c helgaas
2007-07-23 21:28 ` [patch 09/17] ISAPNP: Lindent core.c helgaas
2007-07-23 21:28 ` [patch 10/17] ISAPNP: Lindent proc.c helgaas
2007-07-23 21:28 ` [patch 11/17] PNPBIOS: remove unused bioscalls code helgaas
2007-07-23 21:28 ` [patch 12/17] PNPBIOS: Lindent bioscalls.c helgaas
2007-07-23 21:28 ` [patch 13/17] PNPBIOS: Lindent core.c helgaas
2007-07-23 21:28 ` [patch 14/17] PNPBIOS: Lindent proc.c helgaas
2007-07-23 21:28 ` [patch 15/17] PNPBIOS: Lindent rsparser.c helgaas
2007-07-23 21:28 ` [patch 16/17] PNPACPI: Lindent core.c helgaas
2007-07-23 21:28 ` [patch 17/17] PNPACPI: Lindent rsparser.c helgaas
2007-07-23 22:08 ` [patch 00/17] PNP Lindent Andrew Morton
2007-07-23 22:39   ` Bjorn Helgaas
2007-07-23 22:49     ` Andrew Morton
2007-07-23 22:53       ` Bjorn Helgaas
2007-07-23 23:00         ` Andrew Morton
2007-07-25 16:24           ` Len Brown
2007-07-25 16:57             ` Bjorn Helgaas
2007-07-25 21:53             ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070723213240.751349035@ldl.fc.hp.com \
    --to=helgaas@ldl.fc.hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=ambx1@neo.rr.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=perex@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.