Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7a3a1d8 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller
Browse files

appletalk/ddp.c: Neaten checksum function



atalk_sum_partial can now use the rol16 function in bitops.h

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fd5c0027
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -922,13 +922,8 @@ static unsigned long atalk_sum_partial(const unsigned char *data,
{
	/* This ought to be unwrapped neatly. I'll trust gcc for now */
	while (len--) {
		sum += *data;
		sum <<= 1;
		if (sum & 0x10000) {
			sum++;
			sum &= 0xffff;
		}
		data++;
		sum += *data++;
		sum = rol16(sum, 1);
	}
	return sum;
}