Commit 3d3a8533 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[NET]: Make illegal_highdma more anal

Rather than having illegal_highdma as a macro when HIGHMEM is off, we
can turn it into an inline function that returns zero.  This will catch
callers that give it bad arguments.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 47da8ee6
...@@ -1239,7 +1239,6 @@ void netdev_rx_csum_fault(struct net_device *dev) ...@@ -1239,7 +1239,6 @@ void netdev_rx_csum_fault(struct net_device *dev)
EXPORT_SYMBOL(netdev_rx_csum_fault); EXPORT_SYMBOL(netdev_rx_csum_fault);
#endif #endif
#ifdef CONFIG_HIGHMEM
/* Actually, we should eliminate this check as soon as we know, that: /* Actually, we should eliminate this check as soon as we know, that:
* 1. IOMMU is present and allows to map all the memory. * 1. IOMMU is present and allows to map all the memory.
* 2. No high memory really exists on this machine. * 2. No high memory really exists on this machine.
...@@ -1247,6 +1246,7 @@ EXPORT_SYMBOL(netdev_rx_csum_fault); ...@@ -1247,6 +1246,7 @@ EXPORT_SYMBOL(netdev_rx_csum_fault);
static inline int illegal_highdma(struct net_device *dev, struct sk_buff *skb) static inline int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
{ {
#ifdef CONFIG_HIGHMEM
int i; int i;
if (dev->features & NETIF_F_HIGHDMA) if (dev->features & NETIF_F_HIGHDMA)
...@@ -1256,11 +1256,9 @@ static inline int illegal_highdma(struct net_device *dev, struct sk_buff *skb) ...@@ -1256,11 +1256,9 @@ static inline int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
if (PageHighMem(skb_shinfo(skb)->frags[i].page)) if (PageHighMem(skb_shinfo(skb)->frags[i].page))
return 1; return 1;
#endif
return 0; return 0;
} }
#else
#define illegal_highdma(dev, skb) (0)
#endif
struct dev_gso_cb { struct dev_gso_cb {
void (*destructor)(struct sk_buff *skb); void (*destructor)(struct sk_buff *skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment