[ovs-dev] [PATCH 06/19] datapath: Compatibility code for csum_replace4.

Ben Pfaff blp at nicira.com
Thu Dec 9 17:53:30 UTC 2010


On Wed, Dec 08, 2010 at 10:14:04PM -0800, Jesse Gross wrote:
> Kernels ealier than 2.6.25 did not define csum_replace4, so
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
> +static inline void csum_replace4(__sum16 *sum, __be32 from, __be32 to)
> +{
> +	__be32 diff[] = { ~from, to };
> +
> +	sum = csum_fold(csum_partial((char *)diff, sizeof(diff), ~csum_unfold(*sum)));
> +}
> +#endif

Compared to what I see in mainline Linux, there's an extra cast here.  I
don't see why, because it looks like csum_partial()'s first parameter
has always had type "const void *".

But that is, at worst, harmless, so:
Acked-by: Ben Pfaff <blp at nicira.com>




More information about the dev mailing list