cpmac: remove unused buflen
Subsystems (2)
PATCH 1/2 cpmac: remove unused buflen
--- drivers/net/cpmac.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)
drivers/net/cpmac.c +0 -4
@@ -179,7 +179,6 @@ MODULE_PARM_DESC(dumb_switch, "Assume switch is not connected to MDIO bus");struct cpmac_desc {u32 hw_next;u32 hw_data; -u16 buflen;u16 bufflags;u16 datalen;u16 dataflags;
@@ -415,7 +414,6 @@ static struct sk_buff *cpmac_rx_one(struct cpmac_priv *priv, priv->dev->stats.rx_dropped++; } - desc->buflen =CPMAC_SKB_SIZE ; desc->dataflags =CPMAC_OWN ;return result;
@@ -586,7 +584,6 @@ static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev) DMA_TO_DEVICE); desc->hw_data = (u32 )desc->data_mapping; desc->datalen = len; - desc->buflen = len;if (unlikely (netif_msg_tx_queued (priv)))printk (KERN_DEBUG "%s: sending 0x%p, len=%d\n" , dev->name, skb, skb->len);
@@ -1005,7 +1002,6 @@ static int cpmac_open(struct net_device *dev)CPMAC_SKB_SIZE , DMA_FROM_DEVICE); desc->hw_data = (u32 )desc->data_mapping; - desc->buflen =CPMAC_SKB_SIZE ; desc->dataflags =CPMAC_OWN ; desc->next = &priv->rx_head[(i +1 ) % priv->ring_size]; desc->next->prev = desc;
Signature · 1 line
1.7.3.3
PATCH 2/2 cpmac: fix warning length cast
drivers/net/cpmac.c: In function 'cpmac_start_xmit':drivers/net/cpmac.c:569: warning: comparison of distinct pointer types lacks a cast
--- drivers/net/cpmac.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
drivers/net/cpmac.c +4 -3
@@ -180,7 +180,7 @@ struct cpmac_desc {u32 hw_next;u32 hw_data;u16 bufflags; -u16 datalen; +size_t datalen;u16 dataflags;#define CPMAC_SOP 0x8000#define CPMAC_EOP 0x4000
@@ -554,7 +554,8 @@ fatal_error:static int cpmac_start_xmit (struct sk_buff *skb,struct net_device *dev) { -int queue, len; +int queue; +size_t len;struct cpmac_desc *desc;struct cpmac_priv *priv =netdev_priv (dev);
@@ -564,7 +565,7 @@ static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev)if (unlikely (skb_padto (skb,ETH_ZLEN )))return NETDEV_TX_OK ; - len =max (skb->len,ETH_ZLEN ); + len =max_t (size_t, skb->len,ETH_ZLEN ); queue =skb_get_queue_mapping (skb);netif_stop_subqueue (dev, queue);
Signature · 1 line
1.7.3.3
David Miller
maintainerRe: [PATCH net-next-2.6 2/2] cpmac: fix warning length cast
From: Yoichi Yuasa <[email protected]>
Date: Mon, 13 Dec 2010 17:18:45 +0900
Quoted 5 lines
drivers/net/cpmac.c: In function 'cpmac_start_xmit':drivers/net/cpmac.c:569: warning: comparison of distinct pointer types lacks a castSigned-off-by Yoichi Yuasa <[email protected]>
Again, you cannot change the types of the members of the descriptor, as it has a fixed implementation and is read by the hardware.
David Miller
maintainerFrom: Yoichi Yuasa <[email protected]>
Date: Mon, 13 Dec 2010 17:17:25 +0900
Quoted 1 line
Signed-off-by Yoichi Yuasa <[email protected]>
This is a descriptor read by and used by the hardware, you cannot just delete it.