Skip to content

Commit ee7537b

Browse files
Hantzis Fotisdavem330
authored andcommitted
tcp: tcp_init_wl / tcp_update_wl argument cleanup
The above functions from include/net/tcp.h have been defined with an argument that they never use. The argument is 'u32 ack' which is never used inside the function body, and thus it can be removed. The rest of the patch involves the necessary changes to the function callers of the above two functions. Signed-off-by: Hantzis Fotis <xantzis@ceid.upatras.gr> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c1accad commit ee7537b

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎include/net/tcp.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -825,12 +825,12 @@ static inline void tcp_push_pending_frames(struct sock *sk)
825825
__tcp_push_pending_frames(sk, tcp_current_mss(sk, 1), tp->nonagle);
826826
}
827827

828-
static inline void tcp_init_wl(struct tcp_sock *tp, u32 ack, u32 seq)
828+
static inline void tcp_init_wl(struct tcp_sock *tp, u32 seq)
829829
{
830830
tp->snd_wl1 = seq;
831831
}
832832

833-
static inline void tcp_update_wl(struct tcp_sock *tp, u32 ack, u32 seq)
833+
static inline void tcp_update_wl(struct tcp_sock *tp, u32 seq)
834834
{
835835
tp->snd_wl1 = seq;
836836
}

‎net/ipv4/tcp_input.c‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3416,7 +3416,7 @@ static int tcp_ack_update_window(struct sock *sk, struct sk_buff *skb, u32 ack,
34163416

34173417
if (tcp_may_update_window(tp, ack, ack_seq, nwin)) {
34183418
flag |= FLAG_WIN_UPDATE;
3419-
tcp_update_wl(tp, ack, ack_seq);
3419+
tcp_update_wl(tp, ack_seq);
34203420

34213421
if (tp->snd_wnd != nwin) {
34223422
tp->snd_wnd = nwin;
@@ -3621,7 +3621,7 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
36213621
* No more checks are required.
36223622
* Note, we use the fact that SND.UNA>=SND.WL2.
36233623
*/
3624-
tcp_update_wl(tp, ack, ack_seq);
3624+
tcp_update_wl(tp, ack_seq);
36253625
tp->snd_una = ack;
36263626
flag |= FLAG_WIN_UPDATE;
36273627

@@ -5418,7 +5418,7 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
54185418
* never scaled.
54195419
*/
54205420
tp->snd_wnd = ntohs(th->window);
5421-
tcp_init_wl(tp, TCP_SKB_CB(skb)->ack_seq, TCP_SKB_CB(skb)->seq);
5421+
tcp_init_wl(tp, TCP_SKB_CB(skb)->seq);
54225422

54235423
if (!tp->rx_opt.wscale_ok) {
54245424
tp->rx_opt.snd_wscale = tp->rx_opt.rcv_wscale = 0;
@@ -5679,8 +5679,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
56795679
tp->snd_una = TCP_SKB_CB(skb)->ack_seq;
56805680
tp->snd_wnd = ntohs(th->window) <<
56815681
tp->rx_opt.snd_wscale;
5682-
tcp_init_wl(tp, TCP_SKB_CB(skb)->ack_seq,
5683-
TCP_SKB_CB(skb)->seq);
5682+
tcp_init_wl(tp, TCP_SKB_CB(skb)->seq);
56845683

56855684
/* tcp_ack considers this ACK as duplicate
56865685
* and does not calculate rtt.

‎net/ipv4/tcp_minisocks.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
399399

400400
tcp_prequeue_init(newtp);
401401

402-
tcp_init_wl(newtp, treq->snt_isn, treq->rcv_isn);
402+
tcp_init_wl(newtp, treq->rcv_isn);
403403

404404
newtp->srtt = 0;
405405
newtp->mdev = TCP_TIMEOUT_INIT;

‎net/ipv4/tcp_output.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2337,7 +2337,7 @@ static void tcp_connect_init(struct sock *sk)
23372337
sk->sk_err = 0;
23382338
sock_reset_flag(sk, SOCK_DONE);
23392339
tp->snd_wnd = 0;
2340-
tcp_init_wl(tp, tp->write_seq, 0);
2340+
tcp_init_wl(tp, 0);
23412341
tp->snd_una = tp->write_seq;
23422342
tp->snd_sml = tp->write_seq;
23432343
tp->snd_up = tp->write_seq;

0 commit comments

Comments
 (0)