From: matt mooney <mfm@muteddisk.com>
To: Greg Kroah-Hartman <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH 03/12] staging: usbip: stub_main.c: reorder functions
Date: Thu, 19 May 2011 21:36:57 -0700 [thread overview]
Message-ID: <90bf8151c9cdbd53fd40b53e1d0c9466fae815a5.1305866084.git.mfm@muteddisk.com> (raw)
In-Reply-To: <cover.1305866084.git.mfm@muteddisk.com>
Reorder functions so sysfs_ops, show() and store(), are adjacent, and
init_busid_table() is at the beginning of the file.
Signed-off-by: matt mooney <mfm@muteddisk.com>
---
drivers/staging/usbip/stub_main.c | 48 ++++++++++++++++++------------------
1 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/drivers/staging/usbip/stub_main.c b/drivers/staging/usbip/stub_main.c
index 44671ee..0ca1462 100644
--- a/drivers/staging/usbip/stub_main.c
+++ b/drivers/staging/usbip/stub_main.c
@@ -35,6 +35,21 @@ struct kmem_cache *stub_priv_cache;
static struct bus_id_priv busid_table[MAX_BUSID];
static spinlock_t busid_table_lock;
+static void init_busid_table(void)
+{
+ int i;
+
+ for (i = 0; i < MAX_BUSID; i++) {
+ memset(busid_table[i].name, 0, BUSID_SIZE);
+ busid_table[i].status = STUB_BUSID_OTHER;
+ busid_table[i].interf_count = 0;
+ busid_table[i].sdev = NULL;
+ busid_table[i].shutdown_busid = 0;
+ }
+
+ spin_lock_init(&busid_table_lock);
+}
+
int match_busid(const char *busid)
{
int i;
@@ -69,21 +84,6 @@ struct bus_id_priv *get_busid_priv(const char *busid)
return NULL;
}
-static ssize_t show_match_busid(struct device_driver *drv, char *buf)
-{
- int i;
- char *out = buf;
-
- spin_lock(&busid_table_lock);
- for (i = 0; i < MAX_BUSID; i++)
- if (busid_table[i].name[0])
- out += sprintf(out, "%s ", busid_table[i].name);
- spin_unlock(&busid_table_lock);
-
- out += sprintf(out, "\n");
- return out - buf;
-}
-
static int add_match_busid(char *busid)
{
int i;
@@ -128,19 +128,19 @@ int del_match_busid(char *busid)
return -1;
}
-static void init_busid_table(void)
+static ssize_t show_match_busid(struct device_driver *drv, char *buf)
{
int i;
+ char *out = buf;
- for (i = 0; i < MAX_BUSID; i++) {
- memset(busid_table[i].name, 0, BUSID_SIZE);
- busid_table[i].status = STUB_BUSID_OTHER;
- busid_table[i].interf_count = 0;
- busid_table[i].sdev = NULL;
- busid_table[i].shutdown_busid = 0;
- }
+ spin_lock(&busid_table_lock);
+ for (i = 0; i < MAX_BUSID; i++)
+ if (busid_table[i].name[0])
+ out += sprintf(out, "%s ", busid_table[i].name);
+ spin_unlock(&busid_table_lock);
- spin_lock_init(&busid_table_lock);
+ out += sprintf(out, "\n");
+ return out - buf;
}
static ssize_t store_match_busid(struct device_driver *dev, const char *buf,
--
1.7.5.1
next prev parent reply other threads:[~2011-05-20 4:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-20 4:36 [PATCH 00/12] staging: usbip matt mooney
2011-05-20 4:36 ` [PATCH 01/12] staging: usbip: replace usbip_u{dbg,err,info} and printk with dev_ and pr_ matt mooney
2011-05-20 5:01 ` Greg KH
2011-05-20 5:25 ` matt mooney
2011-05-20 12:53 ` Greg KH
2011-05-20 18:51 ` matt mooney
2011-05-20 4:36 ` [PATCH 02/12] staging: usbip: remove unnecessary lines and extra return statements matt mooney
2011-05-20 4:36 ` matt mooney [this message]
2011-05-20 4:36 ` [PATCH 04/12] staging: usbip: stub_main.c: code cleanup matt mooney
2011-05-20 9:08 ` walter harms
2011-05-20 18:45 ` matt mooney
2011-05-21 11:45 ` walter harms
2011-05-20 4:36 ` [PATCH 05/12] staging: usbip: stub_main.c: rename init and exit functions matt mooney
2011-05-20 4:37 ` [PATCH 06/12] staging: usbip: stub_main.c: use KMEM_CACHE macro matt mooney
2011-05-20 4:37 ` [PATCH 07/12] staging: usbip: usbip_common.c: fix misspelled function name matt mooney
2011-05-20 4:37 ` [PATCH 08/12] staging: usbip: usbip_common.h: reorganize and document request headers matt mooney
2011-05-20 4:37 ` [PATCH 09/12] staging: usbip: stub_dev.c: move stub_driver definition and update driver name matt mooney
2011-05-20 4:37 ` [PATCH 10/12] staging: usbip: userspace: bind_driver.c: update kernel module name matt mooney
2011-05-20 4:37 ` [PATCH 11/12] staging: usbip: usbip_common.c: rename init and exit functions matt mooney
2011-05-20 4:37 ` [PATCH 12/12] staging: usbip: vhci_hcd.c: " matt mooney
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=90bf8151c9cdbd53fd40b53e1d0c9466fae815a5.1305866084.git.mfm@muteddisk.com \
--to=mfm@muteddisk.com \
--cc=greg@kroah.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®