[PATCH 11/11] eCryptfs: Replace magic numbers

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <akpm@...>
Cc: <linux-kernel@...>, <linux-fsdevel@...>, <ecryptfs-devel@...>
Date: Monday, September 17, 2007 - 5:52 pm

Replace some magic numbers with sizeof() equivalents.

Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
---
 fs/ecryptfs/crypto.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index 3b3cf27..425a144 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;
-- 
1.5.1.6

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 11/11] eCryptfs: Replace magic numbers, Michael Halcrow, (Mon Sep 17, 5:52 pm)
[PATCH 6/11] eCryptfs: Update metadata read/write functions, Michael Halcrow, (Mon Sep 17, 5:48 pm)
[PATCH 2/11] eCryptfs: Remove assignments in if-statements, Michael Halcrow, (Mon Sep 17, 5:45 pm)
[PATCH 3/11] eCryptfs: read_write.c routines, Michael Halcrow, (Mon Sep 17, 5:46 pm)
Re: [PATCH 3/11] eCryptfs: read_write.c routines, Andrew Morton, (Thu Sep 20, 1:38 am)
Re: [PATCH 3/11] eCryptfs: read_write.c routines, Michael Halcrow, (Mon Sep 24, 6:12 pm)
Re: [PATCH 3/11] eCryptfs: read_write.c routines, Andrew Morton, (Thu Sep 20, 1:25 am)
[PATCH 1/11] eCryptfs: Remove header_extent_size, Michael Halcrow, (Mon Sep 17, 5:45 pm)