ANDROID: dm: Minor cleanup
authorBadhri Jagan Sridharan <Badhri@google.com>
Mon, 28 Mar 2016 21:41:21 +0000 (14:41 -0700)
committerAmit Pundir <amit.pundir@linaro.org>
Thu, 18 Aug 2016 13:26:03 +0000 (18:56 +0530)
Compacts the linear device arguments removing the
unnecessary variables.

Bug: 27175947
Change-Id: I157170eebe3c0f89a68ae05870a1060f188d0da0
Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
drivers/md/dm-android-verity.c
drivers/md/dm-android-verity.h

index db4ddf789a39466665952272c80265594b41ee2f..f6ddbee5e2d356450987176e4838d03bd0c2b508 100644 (file)
@@ -572,13 +572,10 @@ static inline bool test_mult_overflow(sector_t a, u32 b)
 static int add_as_linear_device(struct dm_target *ti, char *dev)
 {
        /*Move to linear mapping defines*/
-       char *linear_table_args[DM_LINEAR_ARGS];
-       char offset[]  = "0";
+       char *linear_table_args[DM_LINEAR_ARGS] = {dev,
+                                       DM_LINEAR_TARGET_OFFSET};
        int err = 0;
 
-       linear_table_args[0] = dev;
-       linear_table_args[1] = offset;
-
        android_verity_target.dtr = linear_target.dtr,
        android_verity_target.map = linear_target.map,
        android_verity_target.status = linear_target.status,
index 2cf7de1b7910d00208ed6f40ed07a7d818e67904..fe53863c664b46ea923a321846dc2aeb08e7da97 100644 (file)
@@ -46,6 +46,8 @@
 #define DM_MSG_PREFIX                   "android-verity"
 
 #define DM_LINEAR_ARGS 2
+#define DM_LINEAR_TARGET_OFFSET "0"
+
 /*
  * There can be two formats.
  * if fec is present