/*- * Copyright (c) 1991 The Regents of the University of California. * All rights reserved. * * %sccs.include.redist.c% */ #ifndef lint static char sccsid[] = "@(#)dkcksum.c 5.1 (Berkeley) 02/21/91"; #endif /* not lint */ #include #include u_short dkcksum(lp) register struct disklabel *lp; { register u_short *start, *end; register u_short sum = 0; start = (u_short *)lp; end = (u_short *)&lp->d_partitions[lp->d_npartitions]; while (start < end) sum ^= *start++; return (sum); }