Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: fix aliasing in checksum computation
[ upstream commit 24f1955 ] That means a superfluous cast is removed and aliasing through a uint8_t pointer is eliminated. NB: The C standard specifies that a unsigned char pointer may alias while the C standard doesn't include such requirement for uint8_t pointers. Also simplified the loop since a modern C compiler can speed up (i.e. auto-vectorize) it in a similar way. For example, GCC auto-vectorizes it for Haswell using AVX registers while halving the number of instructions in the generated code. Fixes: 6006818 ("net: new checksum functions") Fixes: e079655 ("net: fix build with gcc 4.4.7 and strict aliasing") Signed-off-by: Georg Sauthoff <mail@gms.tf> Reviewed-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
- Loading branch information