* [PATCH] staging: usbip: stub_main.c: simplify busid_table initialization
@ 2011-05-27 8:49 matt mooney
0 siblings, 0 replies; only message in thread
From: matt mooney @ 2011-05-27 8:49 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: kernel-janitors, linux-kernel
Set the whole structure to zero instead of individually setting each
member, which simplifies the for loop.
This was suggested by walter harms <wharms@bfs.de>.
Signed-off-by: matt mooney <mfm@muteddisk.com>
---
drivers/staging/usbip/stub_main.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/usbip/stub_main.c b/drivers/staging/usbip/stub_main.c
index 45a0f5d..a34249a 100644
--- a/drivers/staging/usbip/stub_main.c
+++ b/drivers/staging/usbip/stub_main.c
@@ -39,13 +39,9 @@ static void init_busid_table(void)
{
int i;
- for (i = 0; i < MAX_BUSID; i++) {
- memset(busid_table[i].name, 0, BUSID_SIZE);
+ memset(busid_table, 0, sizeof(busid_table));
+ for (i = 0; i < MAX_BUSID; i++)
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);
}
--
1.7.5.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-05-27 8:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-27 8:49 [PATCH] staging: usbip: stub_main.c: simplify busid_table initialization matt mooney
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®