aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/chelsio
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@ghostprotocols.net>2007-03-31 10:55:19 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:28:29 -0400
commit27d7ff46a3498d3debc6ba68fb8014c702b81170 (patch)
treeb5a0c617cf8339524d3b1f1633e08eae7b94cf86 /drivers/net/chelsio
parent3dbad80ac7632f243b824d469301abb97ec634a1 (diff)
[SK_BUFF]: Introduce skb_copy_to_linear_data{_offset}
To clearly state the intent of copying to linear sk_buffs, _offset being a overly long variant but interesting for the sake of saving some bytes. Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Diffstat (limited to 'drivers/net/chelsio')
-rw-r--r--drivers/net/chelsio/sge.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c
index 1be1bbd16164..e4f874a70fe5 100644
--- a/drivers/net/chelsio/sge.c
+++ b/drivers/net/chelsio/sge.c
@@ -2095,10 +2095,14 @@ static void espibug_workaround_t204(unsigned long data)
2095 0x0, 0x7, 0x43, 0x0, 0x0, 0x0 2095 0x0, 0x7, 0x43, 0x0, 0x0, 0x0
2096 }; 2096 };
2097 2097
2098 memcpy(skb->data + sizeof(struct cpl_tx_pkt), 2098 skb_copy_to_linear_data_offset(skb,
2099 ch_mac_addr, ETH_ALEN); 2099 sizeof(struct cpl_tx_pkt),
2100 memcpy(skb->data + skb->len - 10, 2100 ch_mac_addr,
2101 ch_mac_addr, ETH_ALEN); 2101 ETH_ALEN);
2102 skb_copy_to_linear_data_offset(skb,
2103 skb->len - 10,
2104 ch_mac_addr,
2105 ETH_ALEN);
2102 skb->cb[0] = 0xff; 2106 skb->cb[0] = 0xff;
2103 } 2107 }
2104 2108
@@ -2125,10 +2129,14 @@ static void espibug_workaround(unsigned long data)
2125 if (!skb->cb[0]) { 2129 if (!skb->cb[0]) {
2126 u8 ch_mac_addr[ETH_ALEN] = 2130 u8 ch_mac_addr[ETH_ALEN] =
2127 {0x0, 0x7, 0x43, 0x0, 0x0, 0x0}; 2131 {0x0, 0x7, 0x43, 0x0, 0x0, 0x0};
2128 memcpy(skb->data + sizeof(struct cpl_tx_pkt), 2132 skb_copy_to_linear_data_offset(skb,
2129 ch_mac_addr, ETH_ALEN); 2133 sizeof(struct cpl_tx_pkt),
2130 memcpy(skb->data + skb->len - 10, ch_mac_addr, 2134 ch_mac_addr,
2131 ETH_ALEN); 2135 ETH_ALEN);
2136 skb_copy_to_linear_data_offset(skb,
2137 skb->len - 10,
2138 ch_mac_addr,
2139 ETH_ALEN);
2132 skb->cb[0] = 0xff; 2140 skb->cb[0] = 0xff;
2133 } 2141 }
2134 2142