Set encryption mode in mode file
am: 6e41059734

* commit '6e410597343716924ed4943d1eabd3dea614d325':
  Set encryption mode in mode file

Change-Id: Ic143f9cc8a301178416bd76d3ef6d2593df3dbd6
diff --git a/Android.mk b/Android.mk
index fb5e23e..a0aa0e7 100644
--- a/Android.mk
+++ b/Android.mk
@@ -51,6 +51,7 @@
 	liblogwrap \
 	libext4_utils \
 	libf2fs_sparseblock \
+	libcrypto_utils \
 	libcrypto \
 	libselinux \
 	libutils \
@@ -66,7 +67,6 @@
 	libfec_rs \
 	libsquashfs_utils \
 	libscrypt_static \
-	libmincrypt \
 	libbatteryservice \
 
 vold_conlyflags := -std=c11
diff --git a/MoveTask.cpp b/MoveTask.cpp
index d416718..a6e5fed 100644
--- a/MoveTask.cpp
+++ b/MoveTask.cpp
@@ -27,7 +27,7 @@
 #include <dirent.h>
 #include <sys/wait.h>
 
-#define CONSTRAIN(amount, low, high) (amount < low ? low : (amount > high ? high : amount))
+#define CONSTRAIN(amount, low, high) ((amount) < (low) ? (low) : ((amount) > (high) ? (high) : (amount)))
 
 using android::base::StringPrintf;
 
diff --git a/Utils.cpp b/Utils.cpp
index 7ae22c5..c287797 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -211,7 +211,7 @@
     for (auto line : output) {
         // Extract values from blkid output, if defined
         const char* cline = line.c_str();
-        char* start = strstr(cline, "TYPE=");
+        const char* start = strstr(cline, "TYPE=");
         if (start != nullptr && sscanf(start + 5, "\"%127[^\"]\"", value) == 1) {
             fsType = value;
         }
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 5cc60a1..e1ee96c 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -63,8 +63,8 @@
 
 #define MASS_STORAGE_FILE_PATH  "/sys/class/android_usb/android0/f_mass_storage/lun/file"
 
-#define ROUND_UP_POWER_OF_2(number, po2) (((!!(number & ((1U << po2) - 1))) << po2)\
-                                         + (number & (~((1U << po2) - 1))))
+#define ROUND_UP_POWER_OF_2(number, po2) (((!!((number) & ((1U << (po2)) - 1))) << (po2))\
+                                         + ((number) & (~((1U << (po2)) - 1))))
 
 using android::base::StringPrintf;