[PATCH v3] net: optimize raw checksum computation

Stephen Hemminger stephen at networkplumber.org
Thu Jan 8 01:09:04 CET 2026


On Wed, 7 Jan 2026 17:28:41 -0500
Scott Mitchell <scott.k.mitch1 at gmail.com> wrote:

> (sorry missed this in my last response). I tried this and a few other
> options (compound literal with each field explicitly initialized,
> zero/empty initializer) the only code solution that removed the
> warning was an explicit memset(0), but this also modified the
> assembly. Safest option is to use memset (with some runtime cost) and
> a fallback is to add the zero initializer "just in case the
> compiler/target-architecture requires it" and add `#pragma GCC
> diagnostic ignored "-Wmaybe-uninitialized"` for now to suppress
> warning. I'll push the second option in my next patch and we can
> discuss/adjust accordingly.


No pragma's please. The compiler is usually right.


More information about the dev mailing list