Whamcloud - gitweb
LU-11446 e2fsck: check trusted.link when fixing nlink
[tools/e2fsprogs.git] / lib / ext2fs / bitops.c
index 7c3f215..c4a1d4e 100644 (file)
@@ -24,7 +24,7 @@
 /*
  * For the benefit of those who are trying to port Linux to another
  * architecture, here are some C-language equivalents.  You should
- * recode these in the native assmebly language, if at all possible.
+ * recode these in the native assembly language, if at all possible.
  *
  * C language equivalents written by Theodore Ts'o, 9/26/92.
  * Modified by Pete A. Zaitcev 7/14/95 to be portable to big endian
@@ -138,11 +138,11 @@ unsigned int ext2fs_bitcount(const void *addr, unsigned int nbytes)
        const __u32 *p;
        unsigned int res = 0;
 
-       while (((((unsigned long) cp) & 3) != 0) && (nbytes > 0)) {
+       while (((((uintptr_t) cp) & 3) != 0) && (nbytes > 0)) {
                res += popcount8(*cp++);
                nbytes--;
        }
-       p = (__u32 *) cp;
+       p = (const __u32 *) cp;
 
        while (nbytes > 4) {
                res += popcount32(*p++);