Nathan Chancellor 7425627b2b tcp: Fix -Wc23-extensions in tcp_options_write()
Clang warns (or errors with CONFIG_WERROR=y) when CONFIG_TCP_AO is set:

  net/ipv4/tcp_output.c:663:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions]
    663 |         }
        |         ^
  1 error generated.

On earlier releases (such as clang-11, the current minimum supported
version for building the kernel) that do not support C23, this was a
hard error unconditionally:

  net/ipv4/tcp_output.c:663:2: error: expected statement
          }
          ^
  1 error generated.

While adding a semicolon after the label would resolve this, it is more
in line with the kernel as a whole to refactor this block into a
standalone function, which means the goto a label construct can just be
replaced with a return statement. Do so to resolve the warning.

Closes: https://github.com/ClangBuiltLinux/linux/issues/1953
Fixes: 1e03d32bea8e ("net/tcp: Add TCP-AO sign to outgoing packets")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Dmitry Safonov <dima@arista.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-11-07 22:23:56 +00:00
..
2023-05-31 13:06:57 +02:00
2023-10-25 10:38:07 +01:00
2021-05-17 15:29:35 -07:00
2023-10-01 19:39:18 +01:00
2023-04-13 16:43:38 -07:00
2023-10-16 21:05:33 -07:00
2021-05-17 15:29:35 -07:00
2023-11-03 09:16:42 +00:00
2022-09-20 10:21:49 -07:00
2023-11-03 09:16:42 +00:00
2023-10-27 10:35:46 +01:00
2022-12-20 03:13:45 +01:00
2023-10-27 10:35:46 +01:00
2021-05-17 15:29:35 -07:00
2022-11-16 09:43:35 +00:00
2023-10-30 14:36:57 -07:00
2023-09-14 16:16:36 +02:00
2023-08-29 17:39:15 -07:00