From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 2.4.23-pre3] signed/unsigned mismatches in include/net/tcp.h
Date: Mon, 8 Sep 2003 17:26:48 +0200 [thread overview]
Message-ID: <200309081726.48883@bilbo.math.uni-mannheim.de> (raw)
Hi,
the first one in tcp.h fixes a warning with gcc 3.3: we compare signed with
unsigned. rto is unsigned, so maybe we should cast the left side to u32.
Number 2 changes the type of mss from int to unsigned int. mss is only used to
compare with sbk->len, which is an unsigned. Both callers of this function
use unsigned variables at this point anyway (one is tcp_send_skb from #3).
Please review.
Eike
diff -Naur linux-2.4.23-pre3/include/net/tcp.h linux-2.4.23-pre3-caliban/include/net/tcp.h
--- linux-2.4.23-pre3/include/net/tcp.h 2003-09-05 15:04:50.000000000 +0200
+++ linux-2.4.23-pre3-caliban/include/net/tcp.h 2003-09-07 18:26:50.000000000 +0200
@@ -1123,7 +1123,7 @@
if (tp->packets_out > tp->snd_cwnd_used)
tp->snd_cwnd_used = tp->packets_out;
- if ((s32)(tcp_time_stamp - tp->snd_cwnd_stamp) >= tp->rto)
+ if ((u32)(tcp_time_stamp - tp->snd_cwnd_stamp) >= tp->rto)
tcp_cwnd_application_limited(sk);
}
}
@@ -1166,7 +1166,7 @@
!after(tp->snd_sml, tp->snd_nxt);
}
-static __inline__ void tcp_minshall_update(struct tcp_opt *tp, int mss, struct sk_buff *skb)
+static __inline__ void tcp_minshall_update(struct tcp_opt *tp, unsigned int mss, struct sk_buff *skb)
{
if (skb->len < mss)
tp->snd_sml = TCP_SKB_CB(skb)->end_seq;
diff -Naur linux-2.4.23-pre3/net/ipv4/tcp_output.c linux-2.4.23-pre3-caliban/net/ipv4/tcp_output.c
--- linux-2.4.23-pre3/net/ipv4/tcp_output.c 2003-09-05 15:04:52.000000000 +0200
+++ linux-2.4.23-pre3-caliban/net/ipv4/tcp_output.c 2003-09-07 18:17:04.000000000 +0200
@@ -302,7 +302,7 @@
* NOTE: probe0 timer is not checked, do not forget tcp_push_pending_frames,
* otherwise socket can stall.
*/
-void tcp_send_skb(struct sock *sk, struct sk_buff *skb, int force_queue, unsigned cur_mss)
+void tcp_send_skb(struct sock *sk, struct sk_buff *skb, int force_queue, unsigned int cur_mss)
{
struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp);
reply other threads:[~2003-09-08 15:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200309081726.48883@bilbo.math.uni-mannheim.de \
--to=eike-kernel@sf-tec.de \
--cc=linux-kernel@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
Powered by JetHome