diff mbox

[net-next-2.6,2/2] cpmac: fix warning length cast

Message ID 20101213171845.39a2151f.yuasa@linux-mips.org
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

Yoichi Yuasa Dec. 13, 2010, 8:18 a.m. UTC
drivers/net/cpmac.c: In function 'cpmac_start_xmit':
drivers/net/cpmac.c:569: warning: comparison of distinct pointer types
lacks a cast

Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
---
 drivers/net/cpmac.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

Comments

David Miller Dec. 13, 2010, 6:16 p.m. UTC | #1
From: Yoichi Yuasa <yuasa@linux-mips.org>
Date: Mon, 13 Dec 2010 17:18:45 +0900

> drivers/net/cpmac.c: In function 'cpmac_start_xmit':
> drivers/net/cpmac.c:569: warning: comparison of distinct pointer types
> lacks a cast
> 
> Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>

Again, you cannot change the types of the members of the
descriptor, as it has a fixed implementation and is read
by the hardware.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c
index 8021756..3b606a5 100644
--- a/drivers/net/cpmac.c
+++ b/drivers/net/cpmac.c
@@ -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);