From e4e41ae1cad3fadf384564c860b4c93e8fb895da Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 4 Sep 2013 16:36:12 +0200 Subject: ifpps: Reuse device bitrate for screen_header() Instead of issuing another call to device_bitrate(), reuse the the value acquired in screen_update() and pass it to screen_header(). Signed-off-by: Tobias Klauser --- ifpps.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ifpps.c') diff --git a/ifpps.c b/ifpps.c index b45b05f..60cd3b3 100644 --- a/ifpps.c +++ b/ifpps.c @@ -692,12 +692,11 @@ static void stats_top(const struct ifstat *rel, const struct ifstat *abs, } static void screen_header(WINDOW *screen, const char *ifname, int *voff, - uint64_t ms_interval, unsigned int top_cpus) + u32 rate, uint64_t ms_interval, unsigned int top_cpus) { size_t len = 0; char buff[64], machine[64]; struct ethtool_drvinfo drvinf; - u32 rate = device_bitrate(ifname); int link = ethtool_link(ifname); unsigned int cpus = get_number_cpus(); @@ -1051,7 +1050,7 @@ static void screen_update(WINDOW *screen, const char *ifname, const struct ifsta qsort(cpu_hits, cpus, sizeof(*cpu_hits), cmp_hits); - screen_header(screen, ifname, &voff, ms_interval, top_cpus); + screen_header(screen, ifname, &voff, rate, ms_interval, top_cpus); voff++; screen_net_dev_rel(screen, rel, &voff); -- cgit v1.2.3-54-g00ecf