Currently these kernels share the same strict set of the warnings treated as errors.
This approach comes with a cost: there are more than 100 places in the kernel where variable declarations happen under one of the INET/INET6 defines (or both). Similarly, same happens with IP/IPv6-only functions - they have to be put under the define.
These defines do not improve the code size, as the compilers optimise out unused variables an local functions anyway.
These defines makes the code worse - by making it less readable.
These defines makes the code harder to write, as the developer have to check that all INET* permutation builds.
Address it by removing error-yelling for unused functions and variables if either of INET or INET6 options is not set.
Remove some defines from the networking code that are not required anymore.