eCryptfs: replace magic numbers
authorMichael Halcrow <mhalcrow@us.ibm.com>
Tue, 16 Oct 2007 08:28:14 +0000 (01:28 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 16 Oct 2007 16:43:12 +0000 (09:43 -0700)
Replace some magic numbers with sizeof() equivalents.

Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ecryptfs/crypto.c

index a9ca373c61071ba32b0aeadcc4e85e7eb1f919ce..e890d596da7eea80cfc990fdbc89494a444a4a36 100644 (file)
@@ -1426,10 +1426,10 @@ static int parse_header_metadata(struct ecryptfs_crypt_stat *crypt_stat,
        u32 header_extent_size;
        u16 num_header_extents_at_front;
 
-       memcpy(&header_extent_size, virt, 4);
+       memcpy(&header_extent_size, virt, sizeof(u32));
        header_extent_size = be32_to_cpu(header_extent_size);
-       virt += 4;
-       memcpy(&num_header_extents_at_front, virt, 2);
+       virt += sizeof(u32);
+       memcpy(&num_header_extents_at_front, virt, sizeof(u16));
        num_header_extents_at_front = be16_to_cpu(num_header_extents_at_front);
        crypt_stat->num_header_extents_at_front =
                (int)num_header_extents_at_front;