Skip to contentSkip to conversation

linux-next: net tree build warning

PATCH Applied Stephen Rothwell 4 participants 6 messages Nov 30, 2009 – Dec 2, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi Dave,

Today's linux-next build (x86_64 allmodconfig) produced this warning:

net/sctp/socket.c: In function 'sctp_setsockopt_autoclose':
net/sctp/socket.c:2091: warning: large integer implicitly truncated to unsigned type

Introduced by commit f6778aab6ccc4b510b4dcfa770d9949b696b4545 ("sctp:
limit maximum autoclose setsockopt value") from the net tree.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#1 lore raw
Quoted 9 lines · Stephen Rothwell

Hi Dave,

Today's linux-next build (x86_64 allmodconfig) produced this warning:

net/sctp/socket.c: In function 'sctp_setsockopt_autoclose':
net/sctp/socket.c:2091: warning: large integer implicitly truncated to unsigned type

Introduced by commit f6778aab6ccc4b510b4dcfa770d9949b696b4545 ("sctp:
limit maximum autoclose setsockopt value") from the net tree.

Thanks, the fix is:

- sp->autoclose = MAX_SCHEDULE_TIMEOUT / HZ ;
+ sp->autoclose = (__u32)(MAX_SCHEDULE_TIMEOUT / HZ) ;

I'll reply to this mail with the patch in git format.

Andrei

#2 lore raw

PATCH 1/1 sctp: fix sctp_setsockopt_autoclose compile warning

Fix the following warning, when building on 64 bits:

net/sctp/socket.c:2091: warning: large integer implicitly
truncated to unsigned type

---
 net/sctp/socket.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/sctp/socket.c +1 -1
index 71513b3..8961863 100644
@@ -2088,7 +2088,7 @@ static int sctp_setsockopt_autoclose(struct sock *sk, char __user *optval,
 		return -EFAULT;
 	/* make sure it won't exceed MAX_SCHEDULE_TIMEOUT */
 	if (sp->autoclose > (MAX_SCHEDULE_TIMEOUT / HZ) )
-		sp->autoclose = MAX_SCHEDULE_TIMEOUT / HZ ;
+		sp->autoclose = (__u32)(MAX_SCHEDULE_TIMEOUT / HZ) ;
 
 	return 0;
 }
Signature · 1 line
1.6.5.3
#4 lore raw

Re: [PATCH] sctp: fix sctp_setsockopt_autoclose compile warning

In reply to Andrei Pelinescu-Onciul
Quoted 6 lines · Andrei Pelinescu-Onciul

Fix the following warning, when building on 64 bits:

net/sctp/socket.c:2091: warning: large integer implicitly
truncated to unsigned type

Ack.

-vlad

Quoted 17 lines
---
 net/sctp/socket.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/sctp/socket.c +1 -1
index 71513b3..8961863 100644
@@ -2088,7 +2088,7 @@ static int sctp_setsockopt_autoclose(struct sock *sk, char __user *optval,
 		return -EFAULT;
 	/* make sure it won't exceed MAX_SCHEDULE_TIMEOUT */
 	if (sp->autoclose > (MAX_SCHEDULE_TIMEOUT / HZ) )
-		sp->autoclose = MAX_SCHEDULE_TIMEOUT / HZ ;
+		sp->autoclose = (__u32)(MAX_SCHEDULE_TIMEOUT / HZ) ;
 
 	return 0;
 }
maintainer Applied
#5 lore raw

Re: [PATCH] sctp: fix sctp_setsockopt_autoclose compile warning

From: Vlad Yasevich <[email protected]>
Date: Tue, 01 Dec 2009 14:02:58 -0500

Quoted 11 lines
Quoted 6 lines · Andrei Pelinescu-Onciul

Fix the following warning, when building on 64 bits:

net/sctp/socket.c:2091: warning: large integer implicitly
truncated to unsigned type

Ack.

Applied, but please submit networking patches always CC:'d to [email protected] otherwise they won't get logged in patchwork and therefore are most likely to get lost.