From: Denis Vlasenko Date: Tue, 28 Jun 2005 22:49:06 +0000 (-0700) Subject: [NET]: Micro optimization in eth_header() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ff593c592a5d674822dce31143635b025f6415b2;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [NET]: Micro optimization in eth_header() Signed-off-by: Denis Vlasenko Signed-off-by: David S. Miller --- diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 6617ea47d365..ab60ea63688e 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...