net: Allow csum_add to be provided in arch

csum_add is really nothing more then add-with-carry which
can be implemented efficiently in some architectures.
Allow architecture to define this protected by HAVE_ARCH_CSUM_ADD.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Tom Herbert 2014-05-02 16:28:03 -07:00 коммит произвёл David S. Miller
Родитель 2ad0649687
Коммит 07064c6e02
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -57,12 +57,14 @@ static __inline__ __wsum csum_and_copy_to_user
}
#endif
#ifndef HAVE_ARCH_CSUM_ADD
static inline __wsum csum_add(__wsum csum, __wsum addend)
{
u32 res = (__force u32)csum;
res += (__force u32)addend;
return (__force __wsum)(res + (res < (__force u32)addend));
}
#endif
static inline __wsum csum_sub(__wsum csum, __wsum addend)
{