HomeFreeBSD

Fix unused variable warning in tcp_stacks's rack.c

Description

Fix unused variable warning in tcp_stacks's rack.c

With clang 15, the following -Werror warning is produced:

sys/netinet/tcp_stacks/rack.c:16148:6: error: variable 'cnt_thru' set but not used [-Werror,-Wunused-but-set-variable]
        int cnt_thru = 1;
            ^

The 'cnt_thru' variable is only used when TCP_ACCOUNTING is defined.
Ensure it is only declared and set in that case.

MFC after: 3 days

(cherry picked from commit e967183cb030dfc349c264520e5710bac70bcdd4)

Details

Provenance
dimAuthored on Aug 14 2022, 7:13 PM
Parents
rG59f0eba31e86: Adjust function definition in kern_poll.c to avoid clang 15 warning
Branches
Unknown
Tags
Unknown