Subject: Re: [PATCH v8] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller

From: Mason <[email-masked]>
Date: Wed, 25 Nov 2015 13:36:51 +0100

On 19/11/2015 14:02, Mans Rullgard wrote:

> +	if (dma_mapping_error(&dev->dev, dma_addr)) {
> +		skb_free_frag(data);
> +		return -ENOMEM;
> +	}

I'm back-porting this driver to 4.1

skb_free_frag() was introduced in 4.2 by 181edb2bfa22b IIUC.

+static inline void skb_free_frag(void *addr)
+{
+       __free_page_frag(addr);
+}

Should I just copy the definition of __free_page_frag() ?

/*
 * Frees a page fragment allocated out of either a compound or order 0 page.
 */
void __free_page_frag(void *addr)
{
	struct page *page = virt_to_head_page(addr);

	if (unlikely(put_page_testzero(page)))
		__free_pages_ok(page, compound_order(page));
}

Regards.