2009-11-30 05:40:15

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: net tree build warning

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.
--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (462.00 B)
(No filename) (198.00 B)
Download all attachments

2009-11-30 09:54:32

by Andrei Pelinescu-Onciul

[permalink] [raw]
Subject: Re: linux-next: net tree build warning

On Nov 30, 2009 at 16:40, Stephen Rothwell <[email protected]> wrote:
> 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

2009-11-30 10:03:48

by Andrei Pelinescu-Onciul

[permalink] [raw]
Subject: [PATCH] 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

Signed-off-by: Andrei Pelinescu-Onciul <[email protected]>
---
net/sctp/socket.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 71513b3..8961863 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -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;
}
--
1.6.5.3

2009-11-30 10:06:26

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] sctp: fix sctp_setsockopt_autoclose compile warning


Please CC: all networking patches to [email protected]

Thank you.

2009-12-01 19:02:56

by Vlad Yasevich

[permalink] [raw]
Subject: Re: [PATCH] sctp: fix sctp_setsockopt_autoclose compile warning



Andrei Pelinescu-Onciul wrote:
> Fix the following warning, when building on 64 bits:
>
> net/sctp/socket.c:2091: warning: large integer implicitly
> truncated to unsigned type
>
> Signed-off-by: Andrei Pelinescu-Onciul <[email protected]>

Ack.

-vlad

> ---
> net/sctp/socket.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/sctp/socket.c b/net/sctp/socket.c
> index 71513b3..8961863 100644
> --- a/net/sctp/socket.c
> +++ b/net/sctp/socket.c
> @@ -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;
> }

2009-12-02 09:17:12

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] sctp: fix sctp_setsockopt_autoclose compile warning

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

>
>
> Andrei Pelinescu-Onciul wrote:
>> Fix the following warning, when building on 64 bits:
>>
>> net/sctp/socket.c:2091: warning: large integer implicitly
>> truncated to unsigned type
>>
>> Signed-off-by: Andrei Pelinescu-Onciul <[email protected]>
>
> 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.