aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tokenring
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-04-08 19:50:44 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-08 19:50:44 -0400
commit21f644f3eabde637f255f75ad05d0821a7a36b7f (patch)
tree2dc70aade59bf77c2d156b8e2544906128368f87 /drivers/net/tokenring
parent6adb4f733e9996b4fd68a6db50dd51bd2463ccac (diff)
[NET]: Undo code bloat in hot paths due to print_mac().
If print_mac() is used inside of a pr_debug() the compiler can't see that the call is redundant so still performs it even of pr_debug() ends up being a nop. So don't use print_mac() in such cases in hot code paths, use MAC_FMT et al. instead. As noted by Joe Perches, pr_debug() could be modified to handle this better, but that is a change to an interface used by the entire kernel and thus needs to be validated carefully. This here is thus the less risky fix for 2.6.25 Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tokenring')
-rw-r--r--drivers/net/tokenring/olympic.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index db4ca4f0b846..0ab51a0f35fc 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -1438,13 +1438,18 @@ static void olympic_arb_cmd(struct net_device *dev)
1438 1438
1439 if (olympic_priv->olympic_network_monitor) { 1439 if (olympic_priv->olympic_network_monitor) {
1440 struct trh_hdr *mac_hdr; 1440 struct trh_hdr *mac_hdr;
1441 DECLARE_MAC_BUF(mac);
1442 printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name); 1441 printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name);
1443 mac_hdr = tr_hdr(mac_frame); 1442 mac_hdr = tr_hdr(mac_frame);
1444 printk(KERN_WARNING "%s: MAC Frame Dest. Addr: %s\n", 1443 printk(KERN_WARNING "%s: MAC Frame Dest. Addr: "
1445 dev->name, print_mac(mac, mac_hdr->daddr)); 1444 MAC_FMT " \n", dev->name,
1446 printk(KERN_WARNING "%s: MAC Frame Srce. Addr: %s\n", 1445 mac_hdr->daddr[0], mac_hdr->daddr[1],
1447 dev->name, print_mac(mac, mac_hdr->saddr)); 1446 mac_hdr->daddr[2], mac_hdr->daddr[3],
1447 mac_hdr->daddr[4], mac_hdr->daddr[5]);
1448 printk(KERN_WARNING "%s: MAC Frame Srce. Addr: "
1449 MAC_FMT " \n", dev->name,
1450 mac_hdr->saddr[0], mac_hdr->saddr[1],
1451 mac_hdr->saddr[2], mac_hdr->saddr[3],
1452 mac_hdr->saddr[4], mac_hdr->saddr[5]);
1448 } 1453 }
1449 netif_rx(mac_frame); 1454 netif_rx(mac_frame);
1450 dev->last_rx = jiffies; 1455 dev->last_rx = jiffies;