Re: [PATCH 4/9] Add yaffs ecc, mtd access and nand abstraction code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/03/2010 09:53 AM, cdhmanning@xxxxxxxxx wrote:
From: Charles Manning<cdhmanning@xxxxxxxxx>
[...]
--- /dev/null
+++ b/fs/yaffs2/yaffs_ecc.c
[...]
+
+/* Count the bits in an unsigned char or a U32 */
+
+static int yaffs_count_bits(unsigned char x)
+{
+	int r = 0;
+	while (x) {
+		if (x&  1)
+			r++;
+		x>>= 1;
+	}
+	return r;
+}
+
+static int yaffs_count_bits32(unsigned x)
+{
+	int r = 0;
+	while (x) {
+		if (x&  1)
+			r++;
+		x>>= 1;
+	}
+	return r;
+}
+

These two can probably be replaced with the standard hweight32() and hweight8().

David Daney
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux