From eac63488804d3b49ec6450f8d0bde6ec1b75d49b Mon Sep 17 00:00:00 2001 From: liangbotong Date: Wed, 2 Aug 2023 10:01:55 +0800 Subject: [PATCH] fix NewIP coding style problem Signed-off-by: liangbotong --- .../linux-5.10/drivers/net/bt/btdev_user.h | 3 +-- .../linux-5.10/net/newip/nip_hooks_register.c | 1 - .../linux-5.10/net/newip/tcp_nip_input.c | 22 +++++++++---------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/newip/src/linux-5.10/drivers/net/bt/btdev_user.h b/newip/src/linux-5.10/drivers/net/bt/btdev_user.h index bae2425..7b8f567 100644 --- a/newip/src/linux-5.10/drivers/net/bt/btdev_user.h +++ b/newip/src/linux-5.10/drivers/net/bt/btdev_user.h @@ -22,7 +22,6 @@ #define bt_dev_path_to_file(idx) bt_dev_path(idx) #define bt_virnet_name(idx) (BT_VIRNET_NAME_PREFIX#idx) -#define BT_PATHNAME_MAX 256 #define BT_VIRNET_MAX_NUM 16 #define BT_VIRNET_DATA_HEAD_LEN 2 @@ -43,7 +42,7 @@ */ struct bt_uioc_args { char ifa_name[IFNAMSIZ]; - char cfile_name[BT_PATHNAME_MAX]; + char cfile_name[IFNAMSIZ]; }; #endif diff --git a/newip/src/linux-5.10/net/newip/nip_hooks_register.c b/newip/src/linux-5.10/net/newip/nip_hooks_register.c index 849414e..0fc022d 100644 --- a/newip/src/linux-5.10/net/newip/nip_hooks_register.c +++ b/newip/src/linux-5.10/net/newip/nip_hooks_register.c @@ -57,7 +57,6 @@ int __init ninet_hooks_init(void) { nip_ninet_ehashfn_lhck_register(); nip_ninet_gifconf_lhck_register(); - return 0; } diff --git a/newip/third_party/linux-5.10/net/newip/tcp_nip_input.c b/newip/third_party/linux-5.10/net/newip/tcp_nip_input.c index 3494555..ae554ad 100644 --- a/newip/third_party/linux-5.10/net/newip/tcp_nip_input.c +++ b/newip/third_party/linux-5.10/net/newip/tcp_nip_input.c @@ -1523,19 +1523,11 @@ static void __tcp_nip_ack_calc_ssthresh_default(struct tcp_nip_common *ntp, u32 ntp->nip_ssthresh = nip_ssthresh; } -static void __tcp_nip_ack_calc_ssthresh(struct tcp_nip_common *ntp, struct tcp_sock *tp, - u32 rtt_tstamp, - struct inet_connection_sock *icsk, u32 ack, - int icsk_rto_last) +static void __tcp_nip_ack_calc_ssthresh(struct tcp_nip_common *ntp, u32 rtt_tstamp, + u32 icsk_rto, u32 ack, int icsk_rto_last) { - update_nip_bw(&ntp->nip_bw, tp, rtt_tstamp); - if (ntp->nip_bw < get_nip_br_max_bw()) { - __tcp_nip_ack_calc_ssthresh_bw(ntp, rtt_tstamp, icsk->icsk_rto, ack); - return; - } - if (rtt_tstamp >= get_rtt_tstamp_rto_up()) - __tcp_nip_ack_calc_ssthresh_rto_up(ntp, rtt_tstamp, icsk->icsk_rto, + __tcp_nip_ack_calc_ssthresh_rto_up(ntp, rtt_tstamp, icsk_rto, ack, icsk_rto_last); else if (rtt_tstamp >= get_rtt_tstamp_high()) __tcp_nip_ack_calc_ssthresh_rtt_high(ntp, rtt_tstamp, ack); @@ -1564,7 +1556,13 @@ static void tcp_nip_ack_calc_ssthresh(struct sock *sk, u32 ack, int icsk_rto_las if (skb_snd_tstamp) { u32 rtt_tstamp = tp->rcv_tstamp - skb_snd_tstamp; - __tcp_nip_ack_calc_ssthresh(ntp, tp, rtt_tstamp, icsk, ack, icsk_rto_last); + update_nip_bw(&ntp->nip_bw, tp, rtt_tstamp); + if (ntp->nip_bw < get_nip_br_max_bw()) + __tcp_nip_ack_calc_ssthresh_bw(ntp, rtt_tstamp, icsk->icsk_rto, + ack); + else + __tcp_nip_ack_calc_ssthresh(ntp, rtt_tstamp, icsk->icsk_rto, + ack, icsk_rto_last); } } } -- Gitee