netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pppoe: fix compiler warning
@ 2008-06-24 16:00 Patrick McHardy
  2008-06-24 16:12 ` Herbert Xu
  2008-06-24 20:35 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Patrick McHardy @ 2008-06-24 16:00 UTC (permalink / raw)
  To: David S. Miller; +Cc: Herbert Xu, Linux Netdev List

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: x --]
[-- Type: text/plain, Size: 764 bytes --]

pppoe: fix compiler warning

Fix warning introduced by 392fdb0 (net pppoe: Check packet length on all receive paths):

drivers/net/pppoe.c: In function 'pppoe_recvmsg':
drivers/net/pppoe.c:945: warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Patrick McHardy <kaber@trash.net>
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index bafb69b..fc6f4b8 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -942,7 +942,7 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
 	m->msg_namelen = 0;
 
 	if (skb) {
-		total_len = min(total_len, skb->len);
+		total_len = min_t(size_t, total_len, skb->len);
 		error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len);
 		if (error == 0)
 			error = total_len;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: pppoe: fix compiler warning
  2008-06-24 16:00 pppoe: fix compiler warning Patrick McHardy
@ 2008-06-24 16:12 ` Herbert Xu
  2008-06-24 20:35 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2008-06-24 16:12 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: David S. Miller, Linux Netdev List

On Tue, Jun 24, 2008 at 06:00:06PM +0200, Patrick McHardy wrote:

> pppoe: fix compiler warning
> 
> Fix warning introduced by 392fdb0 (net pppoe: Check packet length on all receive paths):
> 
> drivers/net/pppoe.c: In function 'pppoe_recvmsg':
> drivers/net/pppoe.c:945: warning: comparison of distinct pointer types lacks a cast
> 
> Signed-off-by: Patrick McHardy <kaber@trash.net>

Acked-by: Herbert Xu <herbert@gondor.apana.org.au>

Thanks Patrick!
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: pppoe: fix compiler warning
  2008-06-24 16:00 pppoe: fix compiler warning Patrick McHardy
  2008-06-24 16:12 ` Herbert Xu
@ 2008-06-24 20:35 ` David Miller
  2008-06-25  0:11   ` Patrick McHardy
  1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2008-06-24 20:35 UTC (permalink / raw)
  To: kaber; +Cc: herbert, netdev

From: Patrick McHardy <kaber@trash.net>
Date: Tue, 24 Jun 2008 18:00:06 +0200

> pppoe: fix compiler warning
> 
> Fix warning introduced by 392fdb0 (net pppoe: Check packet length on all receive paths):
> 
> drivers/net/pppoe.c: In function 'pppoe_recvmsg':
> drivers/net/pppoe.c:945: warning: comparison of distinct pointer types lacks a cast
> 
> Signed-off-by: Patrick McHardy <kaber@trash.net>

Should already be fixed in net-2.6 by:

commit 2645a3c3761ac25498db2e627271016c849c68e1
Author: Stephen Hemminger <shemminger@vyatta.com>
Date:   Fri Jun 20 21:58:02 2008 -0700

    pppoe: warning fix
    
    Fix warning:
    drivers/net/pppoe.c: In function 'pppoe_recvmsg':
    drivers/net/pppoe.c:945: warning: comparison of distinct pointer types lacks a cast
    because skb->len is unsigned int and total_len is size_t
    
    Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index bafb69b..fc6f4b8 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -942,7 +942,7 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
 	m->msg_namelen = 0;
 
 	if (skb) {
-		total_len = min(total_len, skb->len);
+		total_len = min_t(size_t, total_len, skb->len);
 		error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len);
 		if (error == 0)
 			error = total_len;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: pppoe: fix compiler warning
  2008-06-24 20:35 ` David Miller
@ 2008-06-25  0:11   ` Patrick McHardy
  0 siblings, 0 replies; 4+ messages in thread
From: Patrick McHardy @ 2008-06-25  0:11 UTC (permalink / raw)
  To: David Miller; +Cc: herbert, netdev

David Miller wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Tue, 24 Jun 2008 18:00:06 +0200
> 
>> pppoe: fix compiler warning
>>
>> Fix warning introduced by 392fdb0 (net pppoe: Check packet length on all receive paths):
>>
>> drivers/net/pppoe.c: In function 'pppoe_recvmsg':
>> drivers/net/pppoe.c:945: warning: comparison of distinct pointer types lacks a cast
>>
>> Signed-off-by: Patrick McHardy <kaber@trash.net>
> 
> Should already be fixed in net-2.6 by:

My mistake, sorry :)




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-06-25  0:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-24 16:00 pppoe: fix compiler warning Patrick McHardy
2008-06-24 16:12 ` Herbert Xu
2008-06-24 20:35 ` David Miller
2008-06-25  0:11   ` Patrick McHardy

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