From: Michael Halcrow Date: Tue, 16 Oct 2007 08:28:14 +0000 (-0700) Subject: eCryptfs: replace magic numbers X-Git-Tag: MMI-PSA29.97-13-9~39582 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ecbdc93639f69c1f237ccce6a9aaff1e83f1182f;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git eCryptfs: replace magic numbers Replace some magic numbers with sizeof() equivalents. Signed-off-by: Michael Halcrow Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index a9ca373c6107..e890d596da7e 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c @@ -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;