aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda@ilport.com.ua>2005-06-28 15:49:06 -0700
committerDavid S. Miller <davem@davemloft.net>2005-06-28 15:49:06 -0700
commitff593c592a5d674822dce31143635b025f6415b2 (patch)
tree9c5ccc28d0cc994aea51991e38c36d75637a8bc8
parent7fe40f73d7591b38f129fe6a9c0fa46e0b192d09 (diff)
[NET]: Micro optimization in eth_header()
Signed-off-by: Denis Vlasenko <vda@ilport.com.ua> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ethernet/eth.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 6617ea47d36..ab60ea63688 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -92,10 +92,9 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type,
* Set the source hardware address.
*/
- if(saddr)
- memcpy(eth->h_source,saddr,dev->addr_len);
- else
- memcpy(eth->h_source,dev->dev_addr,dev->addr_len);
+ if(!saddr)
+ saddr = dev->dev_addr;
+ memcpy(eth->h_source,saddr,dev->addr_len);
/*
* Anyway, the loopback-device should never use this function...