Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[linux-2.6.git] / include / linux / adfs_fs.h
blob0d991071a9d4beb147c2f60e3102723ceac7ffd7
1 #ifndef _ADFS_FS_H
2 #define _ADFS_FS_H
4 #include <uapi/linux/adfs_fs.h>
6 /*
7 * Calculate the boot block checksum on an ADFS drive. Note that this will
8 * appear to be correct if the sector contains all zeros, so also check that
9 * the disk size is non-zero!!!
11 static inline int adfs_checkbblk(unsigned char *ptr)
13 unsigned int result = 0;
14 unsigned char *p = ptr + 511;
16 do {
17 result = (result & 0xff) + (result >> 8);
18 result = result + *--p;
19 } while (p != ptr);
21 return (result & 0xff) != ptr[511];
23 #endif