netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yoichi Yuasa <yuasa@linux-mips.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: yuasa@linux-mips.org, netdev <netdev@vger.kernel.org>,
	Eugene Konev <ejka@imfi.kspu.ru>
Subject: [PATCH net-next-2.6 2/2] cpmac: fix warning length cast
Date: Mon, 13 Dec 2010 17:18:45 +0900	[thread overview]
Message-ID: <20101213171845.39a2151f.yuasa@linux-mips.org> (raw)
In-Reply-To: <20101213171725.2ed299cf.yuasa@linux-mips.org>

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(-)

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);
 
-- 
1.7.3.3


  reply	other threads:[~2010-12-13  8:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-13  8:17 [PATCH net-next-2.6 1/2] cpmac: remove unused buflen Yoichi Yuasa
2010-12-13  8:18 ` Yoichi Yuasa [this message]
2010-12-13 18:16   ` [PATCH net-next-2.6 2/2] cpmac: fix warning length cast David Miller
2010-12-13 18:15 ` [PATCH net-next-2.6 1/2] cpmac: remove unused buflen David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101213171845.39a2151f.yuasa@linux-mips.org \
    --to=yuasa@linux-mips.org \
    --cc=davem@davemloft.net \
    --cc=ejka@imfi.kspu.ru \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).