Skip to content

Commit

Permalink
tipc: Eliminate useless memset operations in Ethernet media support
Browse files Browse the repository at this point in the history
Gets rid of two pointless operations that zero out the array used to
record information about TIPC's Ethernet bearers. There is no need to
initialize the array on start up since it is a global variable that is
already zero'd out, and there is no need to zero it out on exit because
the array is never referenced again.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
  • Loading branch information
Allan Stephens authored and Paul Gortmaker committed Dec 27, 2011
1 parent 64b32f7 commit d47ce2e
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions net/tipc/eth_media.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,6 @@ int tipc_eth_media_start(void)
if (eth_started)
return -EINVAL;

memset(eth_bearers, 0, sizeof(eth_bearers));

res = tipc_register_media(&eth_media_info);
if (res)
return res;
Expand All @@ -396,6 +394,5 @@ void tipc_eth_media_stop(void)

flush_scheduled_work();
unregister_netdevice_notifier(&notifier);
memset(&eth_bearers, 0, sizeof(eth_bearers));
eth_started = 0;
}

0 comments on commit d47ce2e

Please sign in to comment.