Skip to content

Commit

Permalink
staging: usbip: stub_main.c: simplify busid_table initialization
Browse files Browse the repository at this point in the history
Set the whole structure to zero instead of individually setting each
member, which simplifies the for loop.

This was suggested by walter harms <[email protected]>.

Signed-off-by: matt mooney <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
mfmooney authored and gregkh committed Jun 7, 2011
1 parent 1109566 commit 0a186be
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/staging/usbip/stub_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0a186be

Please sign in to comment.