diff --git a/Utils.cpp b/Utils.cpp
index 002af03..f085c22 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -22,26 +22,26 @@
 #include <android-base/file.h>
 #include <android-base/logging.h>
 #include <android-base/properties.h>
-#include <android-base/strings.h>
 #include <android-base/stringprintf.h>
+#include <android-base/strings.h>
 #include <cutils/fs.h>
 #include <logwrap/logwrap.h>
 #include <private/android_filesystem_config.h>
 
-#include <mutex>
 #include <dirent.h>
 #include <fcntl.h>
 #include <linux/fs.h>
 #include <stdlib.h>
 #include <sys/mount.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/sysmacros.h>
-#include <sys/wait.h>
 #include <sys/statvfs.h>
+#include <sys/sysmacros.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <mutex>
 
 #ifndef UMOUNT_NOFOLLOW
-#define UMOUNT_NOFOLLOW    0x00000008  /* Don't follow symlink on umount */
+#define UMOUNT_NOFOLLOW 0x00000008 /* Don't follow symlink on umount */
 #endif
 
 using android::base::ReadFileToString;
@@ -81,8 +81,8 @@
     mode_t mode = 0660 | S_IFBLK;
     if (mknod(cpath, mode, dev) < 0) {
         if (errno != EEXIST) {
-            PLOG(ERROR) << "Failed to create device node for " << major(dev)
-                    << ":" << minor(dev) << " at " << path;
+            PLOG(ERROR) << "Failed to create device node for " << major(dev) << ":" << minor(dev)
+                        << " at " << path;
             res = -errno;
         }
     }
@@ -209,8 +209,8 @@
     return true;
 }
 
-static status_t readMetadata(const std::string& path, std::string* fsType,
-        std::string* fsUuid, std::string* fsLabel, bool untrusted) {
+static status_t readMetadata(const std::string& path, std::string* fsType, std::string* fsUuid,
+                             std::string* fsLabel, bool untrusted) {
     fsType->clear();
     fsUuid->clear();
     fsLabel->clear();
@@ -244,13 +244,13 @@
     return OK;
 }
 
-status_t ReadMetadata(const std::string& path, std::string* fsType,
-        std::string* fsUuid, std::string* fsLabel) {
+status_t ReadMetadata(const std::string& path, std::string* fsType, std::string* fsUuid,
+                      std::string* fsLabel) {
     return readMetadata(path, fsType, fsUuid, fsLabel, false);
 }
 
-status_t ReadMetadataUntrusted(const std::string& path, std::string* fsType,
-        std::string* fsUuid, std::string* fsLabel) {
+status_t ReadMetadataUntrusted(const std::string& path, std::string* fsType, std::string* fsUuid,
+                               std::string* fsLabel) {
     return readMetadata(path, fsType, fsUuid, fsLabel, true);
 }
 
@@ -261,9 +261,9 @@
 status_t ForkExecvp(const std::vector<std::string>& args, security_context_t context) {
     std::lock_guard<std::mutex> lock(kSecurityLock);
     size_t argc = args.size();
-    char** argv = (char**) calloc(argc, sizeof(char*));
+    char** argv = (char**)calloc(argc, sizeof(char*));
     for (size_t i = 0; i < argc; i++) {
-        argv[i] = (char*) args[i].c_str();
+        argv[i] = (char*)args[i].c_str();
         if (i == 0) {
             LOG(VERBOSE) << args[i];
         } else {
@@ -289,13 +289,12 @@
     return res;
 }
 
-status_t ForkExecvp(const std::vector<std::string>& args,
-        std::vector<std::string>& output) {
+status_t ForkExecvp(const std::vector<std::string>& args, std::vector<std::string>& output) {
     return ForkExecvp(args, output, nullptr);
 }
 
-status_t ForkExecvp(const std::vector<std::string>& args,
-        std::vector<std::string>& output, security_context_t context) {
+status_t ForkExecvp(const std::vector<std::string>& args, std::vector<std::string>& output,
+                    security_context_t context) {
     std::lock_guard<std::mutex> lock(kSecurityLock);
     std::string cmd;
     for (size_t i = 0; i < args.size(); i++) {
@@ -314,7 +313,7 @@
             abort();
         }
     }
-    FILE* fp = popen(cmd.c_str(), "r"); // NOLINT
+    FILE* fp = popen(cmd.c_str(), "r");  // NOLINT
     if (context) {
         if (setexeccon(nullptr)) {
             LOG(ERROR) << "Failed to setexeccon";
@@ -341,9 +340,9 @@
 
 pid_t ForkExecvpAsync(const std::vector<std::string>& args) {
     size_t argc = args.size();
-    char** argv = (char**) calloc(argc + 1, sizeof(char*));
+    char** argv = (char**)calloc(argc + 1, sizeof(char*));
     for (size_t i = 0; i < argc; i++) {
-        argv[i] = (char*) args[i].c_str();
+        argv[i] = (char*)args[i].c_str();
         if (i == 0) {
             LOG(VERBOSE) << args[i];
         } else {
@@ -400,10 +399,10 @@
 status_t GenerateRandomUuid(std::string& out) {
     status_t res = ReadRandomBytes(16, out);
     if (res == OK) {
-        out[6] &= 0x0f;  /* clear version        */
-        out[6] |= 0x40;  /* set to version 4     */
-        out[8] &= 0x3f;  /* clear variant        */
-        out[8] |= 0x80;  /* set to IETF variant  */
+        out[6] &= 0x0f; /* clear version        */
+        out[6] |= 0x40; /* set to version 4     */
+        out[8] &= 0x3f; /* clear variant        */
+        out[8] |= 0x80; /* set to IETF variant  */
     }
     return res;
 }
@@ -415,24 +414,26 @@
     for (size_t i = 0; i < hex.size(); i++) {
         int val = 0;
         switch (hex[i]) {
-        case ' ': case '-': case ':': continue;
-        case 'f': case 'F': val = 15; break;
-        case 'e': case 'E': val = 14; break;
-        case 'd': case 'D': val = 13; break;
-        case 'c': case 'C': val = 12; break;
-        case 'b': case 'B': val = 11; break;
-        case 'a': case 'A': val = 10; break;
-        case '9': val = 9; break;
-        case '8': val = 8; break;
-        case '7': val = 7; break;
-        case '6': val = 6; break;
-        case '5': val = 5; break;
-        case '4': val = 4; break;
-        case '3': val = 3; break;
-        case '2': val = 2; break;
-        case '1': val = 1; break;
-        case '0': val = 0; break;
-        default: return -EINVAL;
+            // clang-format off
+            case ' ': case '-': case ':': continue;
+            case 'f': case 'F': val = 15; break;
+            case 'e': case 'E': val = 14; break;
+            case 'd': case 'D': val = 13; break;
+            case 'c': case 'C': val = 12; break;
+            case 'b': case 'B': val = 11; break;
+            case 'a': case 'A': val = 10; break;
+            case '9': val = 9; break;
+            case '8': val = 8; break;
+            case '7': val = 7; break;
+            case '6': val = 6; break;
+            case '5': val = 5; break;
+            case '4': val = 4; break;
+            case '3': val = 3; break;
+            case '2': val = 2; break;
+            case '1': val = 1; break;
+            case '0': val = 0; break;
+            default: return -EINVAL;
+                // clang-format on
         }
 
         if (even) {
@@ -478,7 +479,7 @@
 uint64_t GetFreeBytes(const std::string& path) {
     struct statvfs sb;
     if (statvfs(path.c_str(), &sb) == 0) {
-        return (uint64_t) sb.f_bavail * sb.f_frsize;
+        return (uint64_t)sb.f_bavail * sb.f_frsize;
     } else {
         return -1;
     }
@@ -486,7 +487,7 @@
 
 // TODO: borrowed from frameworks/native/libs/diskusage/ which should
 // eventually be migrated into system/
-static int64_t stat_size(struct stat *s) {
+static int64_t stat_size(struct stat* s) {
     int64_t blksize = s->st_blksize;
     // count actual blocks used instead of nominal file size
     int64_t size = s->st_blocks * 512;
@@ -504,8 +505,8 @@
 int64_t calculate_dir_size(int dfd) {
     int64_t size = 0;
     struct stat s;
-    DIR *d;
-    struct dirent *de;
+    DIR* d;
+    struct dirent* de;
 
     d = fdopendir(dfd);
     if (d == NULL) {
@@ -514,7 +515,7 @@
     }
 
     while ((de = readdir(d))) {
-        const char *name = de->d_name;
+        const char* name = de->d_name;
         if (fstatat(dfd, name, &s, AT_SYMLINK_NOFOLLOW) == 0) {
             size += stat_size(&s);
         }
@@ -523,10 +524,8 @@
 
             /* always skip "." and ".." */
             if (name[0] == '.') {
-                if (name[1] == 0)
-                    continue;
-                if ((name[1] == '.') && (name[2] == 0))
-                    continue;
+                if (name[1] == 0) continue;
+                if ((name[1] == '.') && (name[2] == 0)) continue;
             }
 
             subfd = openat(dfd, name, O_RDONLY | O_DIRECTORY | O_CLOEXEC);
@@ -576,7 +575,7 @@
     }
 
     range[0] = 0;
-    range[1] = (unsigned long long) nr_sec * 512;
+    range[1] = (unsigned long long)nr_sec * 512;
 
     LOG(INFO) << "About to discard " << range[1] << " on " << path;
     if (ioctl(fd, BLKDISCARD, &range) == 0) {
@@ -592,8 +591,7 @@
 }
 
 static bool isValidFilename(const std::string& name) {
-    if (name.empty() || (name == ".") || (name == "..")
-            || (name.find('/') != std::string::npos)) {
+    if (name.empty() || (name == ".") || (name == "..") || (name.find('/') != std::string::npos)) {
         return false;
     } else {
         return true;
@@ -713,8 +711,7 @@
     while (true) {
         ssize_t size = readlinkat(dirfd, path.c_str(), &buf[0], buf.size());
         // Unrecoverable error?
-        if (size == -1)
-            return false;
+        if (size == -1) return false;
         // It fit! (If size == buf.size(), it may have been truncated.)
         if (static_cast<size_t>(size) < buf.size()) {
             result->assign(&buf[0], size);
