mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
skb: Add inline helper for getting the skb end offset from head
With the recent changes for how we compute the skb truesize it occurs to me we are probably going to have a lot of calls to skb_end_pointer - skb->head. Instead of running all over the place doing that it would make more sense to just make it a separate inline skb_end_offset(skb) that way we can return the correct value without having gcc having to do all the optimization to cancel out skb->head - skb->head. Signed-off-by: Alexander Duyck <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
3e24591a19
commit
ec47ea8247
6 changed files with 21 additions and 11 deletions
|
|
@ -802,7 +802,7 @@ static void fill_rx_pool (amb_dev * dev, unsigned char pool,
|
|||
}
|
||||
// cast needed as there is no %? for pointer differences
|
||||
PRINTD (DBG_SKB, "allocated skb at %p, head %p, area %li",
|
||||
skb, skb->head, (long) (skb_end_pointer(skb) - skb->head));
|
||||
skb, skb->head, (long) skb_end_offset(skb));
|
||||
rx.handle = virt_to_bus (skb);
|
||||
rx.host_address = cpu_to_be32 (virt_to_bus (skb->data));
|
||||
if (rx_give (dev, &rx, pool))
|
||||
|
|
|
|||
|
|
@ -1258,7 +1258,7 @@ idt77252_rx_raw(struct idt77252_dev *card)
|
|||
tail = readl(SAR_REG_RAWCT);
|
||||
|
||||
pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(queue),
|
||||
skb_end_pointer(queue) - queue->head - 16,
|
||||
skb_end_offset(queue) - 16,
|
||||
PCI_DMA_FROMDEVICE);
|
||||
|
||||
while (head != tail) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue