HomeFreeBSD

Fix unused variable warnings in sctp_indata.c

Description

Fix unused variable warnings in sctp_indata.c

With clang 15, the following -Werror warnings are produced:

sys/netinet/sctp_indata.c:3309:6: error: variable 'tot_retrans' set but not used [-Werror,-Wunused-but-set-variable]
        int tot_retrans = 0;
            ^
sys/netinet/sctp_indata.c:3842:20: error: variable 'resend' set but not used [-Werror,-Wunused-but-set-variable]
        int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0;
                          ^
sys/netinet/sctp_indata.c:3842:47: error: variable 'acked' set but not used [-Werror,-Wunused-but-set-variable]
        int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0;
                                                     ^
sys/netinet/sctp_indata.c:3842:58: error: variable 'above' set but not used [-Werror,-Wunused-but-set-variable]
        int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0;
                                                                ^

The 'tot_retrans' variable was used in sctp_strike_gap_ack_chunks(), but
refactoring in 493d8e5a830e got rid of it. Remove the variable since it
no longer serves any purpose.

The 'resend', 'acked', and 'above' variables are only used when
INVARIANTS is undefined. Ensure they are only declared and set in that
case.

MFC after: 3 days

Details

Provenance
dimAuthored on Jul 25 2022, 7:15 PM
Parents
rG766f3c8032a9: Adjust function definitions in if_pfsync.c to avoid clang 15 warnings
Branches
Unknown
Tags
Unknown