staging: usbip: stub_main.c: simplify busid_table initialization
authormatt mooney <mfm@muteddisk.com>
Fri, 27 May 2011 08:49:24 +0000 (01:49 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 7 Jun 2011 21:29:16 +0000 (14:29 -0700)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/usbip/stub_main.c

index 45a0f5dfcb184996a3b121e64180029c7ff227df..a34249a9cb6e1c82934611cfa0e3522e8824dcee 100644 (file)
@@ -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);
 }