[goldfish] Run fx format-code

This is needed before making any changes to this code
in order for it to be properly reviewed.
The fx formatter now formats the entire file
rather than changed lines, so CLs like this are
necessary to maintain the codebase.

Change-Id: I4e0b236d2de026cd5b5735a474e763a6e4bb59d6
diff --git a/BUILD.gn b/BUILD.gn
index 8bdba38..ae9597b 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -3,14 +3,14 @@
     "android-emu/aemu/base/AlignedBuf.cpp",
     "android-emu/aemu/base/AlignedBuf.h",
     "android-emu/aemu/base/Allocator.h",
-    "android-emu/aemu/base/AndroidSubAllocator.cpp",
-    "android-emu/aemu/base/AndroidSubAllocator.h",
-    "android-emu/aemu/base/BumpPool.h",
     "android-emu/aemu/base/AndroidHealthMonitor.cpp",
     "android-emu/aemu/base/AndroidHealthMonitor.h",
     "android-emu/aemu/base/AndroidHealthMonitorConsumer.h",
     "android-emu/aemu/base/AndroidHealthMonitorConsumerBasic.cpp",
     "android-emu/aemu/base/AndroidHealthMonitorConsumerBasic.h",
+    "android-emu/aemu/base/AndroidSubAllocator.cpp",
+    "android-emu/aemu/base/AndroidSubAllocator.h",
+    "android-emu/aemu/base/BumpPool.h",
     "android-emu/aemu/base/Pool.cpp",
     "android-emu/aemu/base/Pool.h",
     "android-emu/aemu/base/Process.cpp",
diff --git a/fuchsia/fuchsia_stdio.cc b/fuchsia/fuchsia_stdio.cc
index acfb2ca..5948250 100644
--- a/fuchsia/fuchsia_stdio.cc
+++ b/fuchsia/fuchsia_stdio.cc
@@ -7,83 +7,66 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-void __assert_fail(const char *expr, const char *file, int line, const char *func)
-{
-  FX_LOGF(ERROR, "goldfish", "Assertion failed: %s (%s: %s: %d)", expr, file, func, line);
-  abort();
+void __assert_fail(const char* expr, const char* file, int line, const char* func) {
+    FX_LOGF(ERROR, "goldfish", "Assertion failed: %s (%s: %s: %d)", expr, file, func, line);
+    abort();
 }
 
-int puts(const char *s)
-{
-  return fputs(s, stdout);
-}
+int puts(const char* s) { return fputs(s, stdout); }
 
-int printf(const char *format, ...)
-{
-  va_list args;
-  va_start(args, format);
-  vfprintf(stdout, format, args);
-  va_end(args);
-  return 0;
-}
-
-int vprintf(const char *format, va_list ap)
-{
-  return vfprintf(stdout, format, ap);
-}
-
-int fprintf(FILE *stream, const char *format, ...)
-{
-  assert(stream == stdout || stream == stderr);
-  if (stream == stdout || stream == stderr)
-  {
+int printf(const char* format, ...) {
     va_list args;
     va_start(args, format);
-    vfprintf(stream, format, args);
+    vfprintf(stdout, format, args);
     va_end(args);
-  }
-  return 0;
+    return 0;
 }
 
-static inline fx_log_severity_t severity(FILE *stream)
-{
-  return stream == stdout ? FX_LOG_INFO : FX_LOG_ERROR;
+int vprintf(const char* format, va_list ap) { return vfprintf(stdout, format, ap); }
+
+int fprintf(FILE* stream, const char* format, ...) {
+    assert(stream == stdout || stream == stderr);
+    if (stream == stdout || stream == stderr) {
+        va_list args;
+        va_start(args, format);
+        vfprintf(stream, format, args);
+        va_end(args);
+    }
+    return 0;
 }
 
-int fputs(const char *s, FILE *stream)
-{
-  assert(stream == stdout || stream == stderr);
-  if (stream == stdout || stream == stderr)
-  {
-    _FX_LOG(severity(stream), "goldfish", s);
-  }
-  return 0;
+static inline fx_log_severity_t severity(FILE* stream) {
+    return stream == stdout ? FX_LOG_INFO : FX_LOG_ERROR;
 }
 
-int vfprintf(FILE *stream, const char *format, va_list ap)
-{
-  assert(stream == stdout || stream == stderr);
-  if (stream == stdout || stream == stderr)
-  {
-    _FX_LOGVF(severity(stream), "goldfish", __FILE__, __LINE__,format, ap);
-  }
-  return 0;
+int fputs(const char* s, FILE* stream) {
+    assert(stream == stdout || stream == stderr);
+    if (stream == stdout || stream == stderr) {
+        _FX_LOG(severity(stream), "goldfish", s);
+    }
+    return 0;
 }
 
-size_t fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream)
-{
-  assert(stream == stdout || stream == stderr);
-  char buffer[512];
-  size_t offset = 0;
-  size_t count = 0;
-  for (; count < nitems; count++)
-  {
-    snprintf(buffer + offset, sizeof(buffer) - offset, reinterpret_cast<const char *>(ptr) + offset, size);
-    offset += size;
-    if (offset > sizeof(buffer))
-      break;
-  }
-  buffer[sizeof(buffer) - 1] = 0;
-  fputs(buffer, stream);
-  return count;
+int vfprintf(FILE* stream, const char* format, va_list ap) {
+    assert(stream == stdout || stream == stderr);
+    if (stream == stdout || stream == stderr) {
+        _FX_LOGVF(severity(stream), "goldfish", __FILE__, __LINE__, format, ap);
+    }
+    return 0;
+}
+
+size_t fwrite(const void* ptr, size_t size, size_t nitems, FILE* stream) {
+    assert(stream == stdout || stream == stderr);
+    char buffer[512];
+    size_t offset = 0;
+    size_t count = 0;
+    for (; count < nitems; count++) {
+        snprintf(buffer + offset, sizeof(buffer) - offset,
+                 reinterpret_cast<const char*>(ptr) + offset, size);
+        offset += size;
+        if (offset > sizeof(buffer)) break;
+    }
+    buffer[sizeof(buffer) - 1] = 0;
+    fputs(buffer, stream);
+    return count;
 }
diff --git a/fuchsia/port.cc b/fuchsia/port.cc
index 7c0a338..d68c1ca 100644
--- a/fuchsia/port.cc
+++ b/fuchsia/port.cc
@@ -9,8 +9,8 @@
 #include <cstdarg>
 #include <cstdint>
 #include <cstdio>
-#include <thread>
 #include <cstring>
+#include <thread>
 
 #if defined(__Fuchsia__)
 #include <lib/syslog/global.h>
@@ -24,79 +24,75 @@
 extern "C" {
 
 #if !defined(__Fuchsia__)
-static void linux_log_prefix(const char *prefix, const char *file, int line, const char *format,
-                             va_list ap, ...)
-{
-  char buf[50];
-  char *dup = strdup(file);
-  if (!dup)
-    return;
+static void linux_log_prefix(const char* prefix, const char* file, int line, const char* format,
+                             va_list ap, ...) {
+    char buf[50];
+    char* dup = strdup(file);
+    if (!dup) return;
 
-  snprintf(buf, sizeof(buf), "[%s(%d)]", basename(dup), line);
-  fprintf(stderr, "%s\n", buf);
-  vfprintf(stderr, format, ap);
+    snprintf(buf, sizeof(buf), "[%s(%d)]", basename(dup), line);
+    fprintf(stderr, "%s\n", buf);
+    vfprintf(stderr, format, ap);
 
-  free(dup);
+    free(dup);
 }
 #endif
 
-int property_get(const char* key, char* value, const char* default_value) {
-  return 0;
-}
+int property_get(const char* key, char* value, const char* default_value) { return 0; }
 
-int __android_log_print(int priority, const char* tag, const char* file,
-                        int line, const char* format, ...) {
-  const char* local_tag = tag;
-  if (!local_tag) {
-    local_tag = "<NO_TAG>";
-  }
+int __android_log_print(int priority, const char* tag, const char* file, int line,
+                        const char* format, ...) {
+    const char* local_tag = tag;
+    if (!local_tag) {
+        local_tag = "<NO_TAG>";
+    }
 
-  va_list ap;
-  va_start(ap, format);
+    va_list ap;
+    va_start(ap, format);
 #if defined(__Fuchsia__)
-  switch (priority) {
-    case ANDROID_LOG_VERBOSE:
-    case ANDROID_LOG_DEBUG:
-      FX_LOGVF(DEBUG, local_tag, file, line, format, ap);
-      break;
-    case ANDROID_LOG_WARN:
-      FX_LOGVF(WARNING, local_tag, file, line, format, ap);
-      break;
-    case ANDROID_LOG_ERROR:
-      FX_LOGVF(ERROR, local_tag, file, line, format, ap);
-      break;
-    case ANDROID_LOG_FATAL:
-      FX_LOGVF(FATAL, local_tag, file, line, format, ap);
-      break;
-    case ANDROID_LOG_INFO:
-    default:
-      FX_LOGVF(INFO, local_tag, file, line, format, ap);
-      break;
-  }
+    switch (priority) {
+        case ANDROID_LOG_VERBOSE:
+        case ANDROID_LOG_DEBUG:
+            FX_LOGVF(DEBUG, local_tag, file, line, format, ap);
+            break;
+        case ANDROID_LOG_WARN:
+            FX_LOGVF(WARNING, local_tag, file, line, format, ap);
+            break;
+        case ANDROID_LOG_ERROR:
+            FX_LOGVF(ERROR, local_tag, file, line, format, ap);
+            break;
+        case ANDROID_LOG_FATAL:
+            FX_LOGVF(FATAL, local_tag, file, line, format, ap);
+            break;
+        case ANDROID_LOG_INFO:
+        default:
+            FX_LOGVF(INFO, local_tag, file, line, format, ap);
+            break;
+    }
 #else
-  linux_log_prefix(local_tag, file, line, format, ap);
+    linux_log_prefix(local_tag, file, line, format, ap);
 #endif
 
-  return 1;
+    return 1;
 }
 
-void __android_log_assert(const char* condition, const char* tag,
-                          const char* file, int line, const char* format, ...) {
-  const char* local_tag = tag;
-  if (!local_tag) {
-    local_tag = "<NO_TAG>";
-  }
-  va_list ap;
-  va_start(ap, format);
+void __android_log_assert(const char* condition, const char* tag, const char* file, int line,
+                          const char* format, ...) {
+    const char* local_tag = tag;
+    if (!local_tag) {
+        local_tag = "<NO_TAG>";
+    }
+    va_list ap;
+    va_start(ap, format);
 #if defined(__Fuchsia__)
-  FX_LOGVF(ERROR, local_tag, file, line, format, ap);
+    FX_LOGVF(ERROR, local_tag, file, line, format, ap);
 #else
-  linux_log_prefix(local_tag, file, line, format, ap);
+    linux_log_prefix(local_tag, file, line, format, ap);
 #endif
 
-  va_end(ap);
+    va_end(ap);
 
-  abort();
+    abort();
 }
 
 int sync_wait(int fd, int timeout) { return -1; }
diff --git a/system/vulkan/goldfish_vulkan.cpp b/system/vulkan/goldfish_vulkan.cpp
index c6f5650..6b45e47 100644
--- a/system/vulkan/goldfish_vulkan.cpp
+++ b/system/vulkan/goldfish_vulkan.cpp
@@ -11,11 +11,9 @@
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
-#include <hardware/hwvulkan.h>
-
-#include <log/log.h>
-
 #include <errno.h>
+#include <hardware/hwvulkan.h>
+#include <log/log.h>
 #include <string.h>
 #ifdef VK_USE_PLATFORM_FUCHSIA
 #include <fidl/fuchsia.logger/cpp/wire.h>
@@ -39,30 +37,23 @@
 // Copied from frameworks/native/vulkan/libvulkan/stubhal.cpp
 namespace vkstubhal {
 
-[[noreturn]] VKAPI_ATTR void NoOp() {
-    LOG_ALWAYS_FATAL("invalid stub function called");
-}
+[[noreturn]] VKAPI_ATTR void NoOp() { LOG_ALWAYS_FATAL("invalid stub function called"); }
 
-VkResult
-EnumerateInstanceExtensionProperties(const char* /*layer_name*/,
-                                     uint32_t* count,
-                                     VkExtensionProperties* /*properties*/) {
+VkResult EnumerateInstanceExtensionProperties(const char* /*layer_name*/, uint32_t* count,
+                                              VkExtensionProperties* /*properties*/) {
     AEMU_SCOPED_TRACE("vkstubhal::EnumerateInstanceExtensionProperties");
     *count = 0;
     return VK_SUCCESS;
 }
 
-VkResult
-EnumerateInstanceLayerProperties(uint32_t* count,
-                                 VkLayerProperties* /*properties*/) {
+VkResult EnumerateInstanceLayerProperties(uint32_t* count, VkLayerProperties* /*properties*/) {
     AEMU_SCOPED_TRACE("vkstubhal::EnumerateInstanceLayerProperties");
     *count = 0;
     return VK_SUCCESS;
 }
 
 VkResult CreateInstance(const VkInstanceCreateInfo* /*create_info*/,
-                        const VkAllocationCallbacks* /*allocator*/,
-                        VkInstance* instance) {
+                        const VkAllocationCallbacks* /*allocator*/, VkInstance* instance) {
     AEMU_SCOPED_TRACE("vkstubhal::CreateInstance");
     auto dispatch = new hwvulkan_dispatch_t;
     dispatch->magic = HWVULKAN_DISPATCH_MAGIC;
@@ -70,8 +61,7 @@
     return VK_SUCCESS;
 }
 
-void DestroyInstance(VkInstance instance,
-                     const VkAllocationCallbacks* /*allocator*/) {
+void DestroyInstance(VkInstance instance, const VkAllocationCallbacks* /*allocator*/) {
     AEMU_SCOPED_TRACE("vkstubhal::DestroyInstance");
     auto dispatch = reinterpret_cast<hwvulkan_dispatch_t*>(instance);
     ALOG_ASSERT(dispatch->magic == HWVULKAN_DISPATCH_MAGIC,
@@ -79,8 +69,7 @@
     delete dispatch;
 }
 
-VkResult EnumeratePhysicalDevices(VkInstance /*instance*/,
-                                  uint32_t* count,
+VkResult EnumeratePhysicalDevices(VkInstance /*instance*/, uint32_t* count,
                                   VkPhysicalDevice* /*gpus*/) {
     AEMU_SCOPED_TRACE("vkstubhal::EnumeratePhysicalDevices");
     *count = 0;
@@ -93,171 +82,136 @@
     return VK_SUCCESS;
 }
 
-VkResult
-EnumeratePhysicalDeviceGroups(VkInstance /*instance*/,
-                              uint32_t* count,
-                              VkPhysicalDeviceGroupProperties* /*properties*/) {
+VkResult EnumeratePhysicalDeviceGroups(VkInstance /*instance*/, uint32_t* count,
+                                       VkPhysicalDeviceGroupProperties* /*properties*/) {
     AEMU_SCOPED_TRACE("vkstubhal::EnumeratePhysicalDeviceGroups");
     *count = 0;
     return VK_SUCCESS;
 }
 
-VkResult
-CreateDebugReportCallbackEXT(VkInstance /*instance*/,
-                             const VkDebugReportCallbackCreateInfoEXT* /*pCreateInfo*/,
-                             const VkAllocationCallbacks* /*pAllocator*/,
-                             VkDebugReportCallbackEXT* pCallback)
-{
+VkResult CreateDebugReportCallbackEXT(VkInstance /*instance*/,
+                                      const VkDebugReportCallbackCreateInfoEXT* /*pCreateInfo*/,
+                                      const VkAllocationCallbacks* /*pAllocator*/,
+                                      VkDebugReportCallbackEXT* pCallback) {
     AEMU_SCOPED_TRACE("vkstubhal::CreateDebugReportCallbackEXT");
     *pCallback = VK_NULL_HANDLE;
     return VK_SUCCESS;
 }
 
-void
-DestroyDebugReportCallbackEXT(VkInstance /*instance*/,
-                              VkDebugReportCallbackEXT /*callback*/,
-                              const VkAllocationCallbacks* /*pAllocator*/)
-{
+void DestroyDebugReportCallbackEXT(VkInstance /*instance*/, VkDebugReportCallbackEXT /*callback*/,
+                                   const VkAllocationCallbacks* /*pAllocator*/) {
     AEMU_SCOPED_TRACE("vkstubhal::DestroyDebugReportCallbackEXT");
 }
 
-void
-DebugReportMessageEXT(VkInstance /*instance*/,
-                      VkDebugReportFlagsEXT /*flags*/,
-                      VkDebugReportObjectTypeEXT /*objectType*/,
-                      uint64_t /*object*/,
-                      size_t /*location*/,
-                      int32_t /*messageCode*/,
-                      const char* /*pLayerPrefix*/,
-                      const char* /*pMessage*/)
-{
+void DebugReportMessageEXT(VkInstance /*instance*/, VkDebugReportFlagsEXT /*flags*/,
+                           VkDebugReportObjectTypeEXT /*objectType*/, uint64_t /*object*/,
+                           size_t /*location*/, int32_t /*messageCode*/,
+                           const char* /*pLayerPrefix*/, const char* /*pMessage*/) {
     AEMU_SCOPED_TRACE("vkstubhal::DebugReportMessageEXT");
 }
 
-VkResult
-CreateDebugUtilsMessengerEXT(VkInstance /*instance*/,
-                             const VkDebugUtilsMessengerCreateInfoEXT* /*pCreateInfo*/,
-                             const VkAllocationCallbacks* /*pAllocator*/,
-                             VkDebugUtilsMessengerEXT* pMessenger)
-{
+VkResult CreateDebugUtilsMessengerEXT(VkInstance /*instance*/,
+                                      const VkDebugUtilsMessengerCreateInfoEXT* /*pCreateInfo*/,
+                                      const VkAllocationCallbacks* /*pAllocator*/,
+                                      VkDebugUtilsMessengerEXT* pMessenger) {
     AEMU_SCOPED_TRACE("vkstubhal::CreateDebugUtilsMessengerEXT");
     *pMessenger = VK_NULL_HANDLE;
     return VK_SUCCESS;
 }
 
-void
-DestroyDebugUtilsMessengerEXT(VkInstance /*instance*/,
-                              VkDebugUtilsMessengerEXT /*messenger*/,
-                              const VkAllocationCallbacks* /*pAllocator*/)
-{
+void DestroyDebugUtilsMessengerEXT(VkInstance /*instance*/, VkDebugUtilsMessengerEXT /*messenger*/,
+                                   const VkAllocationCallbacks* /*pAllocator*/) {
     AEMU_SCOPED_TRACE("vkstubhal::DestroyDebugUtilsMessengerkEXT");
 }
 
-void
-SubmitDebugUtilsMessageEXT(VkInstance /*instance*/,
-                           VkDebugUtilsMessageSeverityFlagBitsEXT /*messageSeverity*/,
-                           VkDebugUtilsMessageTypeFlagsEXT /*messageTypes*/,
-                           const VkDebugUtilsMessengerCallbackDataEXT* /*pCallbackData*/)
-{
+void SubmitDebugUtilsMessageEXT(VkInstance /*instance*/,
+                                VkDebugUtilsMessageSeverityFlagBitsEXT /*messageSeverity*/,
+                                VkDebugUtilsMessageTypeFlagsEXT /*messageTypes*/,
+                                const VkDebugUtilsMessengerCallbackDataEXT* /*pCallbackData*/) {
     AEMU_SCOPED_TRACE("vkstubhal::SubmitDebugUtilsMessageEXT");
 }
 
 #ifdef VK_USE_PLATFORM_FUCHSIA
-VkResult
-GetMemoryZirconHandleFUCHSIA(VkDevice /*device*/,
-                             const VkMemoryGetZirconHandleInfoFUCHSIA* /*pInfo*/,
-                             uint32_t* pHandle) {
+VkResult GetMemoryZirconHandleFUCHSIA(VkDevice /*device*/,
+                                      const VkMemoryGetZirconHandleInfoFUCHSIA* /*pInfo*/,
+                                      uint32_t* pHandle) {
     AEMU_SCOPED_TRACE("vkstubhal::GetMemoryZirconHandleFUCHSIA");
     *pHandle = 0;
     return VK_SUCCESS;
 }
 
-VkResult
-GetMemoryZirconHandlePropertiesFUCHSIA(VkDevice /*device*/,
-                                       VkExternalMemoryHandleTypeFlagBits /*handleType*/,
-                                       uint32_t /*handle*/,
-                                       VkMemoryZirconHandlePropertiesFUCHSIA* /*pProperties*/) {
+VkResult GetMemoryZirconHandlePropertiesFUCHSIA(
+    VkDevice /*device*/, VkExternalMemoryHandleTypeFlagBits /*handleType*/, uint32_t /*handle*/,
+    VkMemoryZirconHandlePropertiesFUCHSIA* /*pProperties*/) {
     AEMU_SCOPED_TRACE("vkstubhal::GetMemoryZirconHandlePropertiesFUCHSIA");
     return VK_SUCCESS;
 }
 
-VkResult
-GetSemaphoreZirconHandleFUCHSIA(VkDevice /*device*/,
-                                const VkSemaphoreGetZirconHandleInfoFUCHSIA* /*pInfo*/,
-                                uint32_t* pHandle) {
+VkResult GetSemaphoreZirconHandleFUCHSIA(VkDevice /*device*/,
+                                         const VkSemaphoreGetZirconHandleInfoFUCHSIA* /*pInfo*/,
+                                         uint32_t* pHandle) {
     AEMU_SCOPED_TRACE("vkstubhal::GetSemaphoreZirconHandleFUCHSIA");
     *pHandle = 0;
     return VK_SUCCESS;
 }
 
-VkResult
-ImportSemaphoreZirconHandleFUCHSIA(VkDevice /*device*/,
-                                   const VkImportSemaphoreZirconHandleInfoFUCHSIA* /*pInfo*/) {
+VkResult ImportSemaphoreZirconHandleFUCHSIA(
+    VkDevice /*device*/, const VkImportSemaphoreZirconHandleInfoFUCHSIA* /*pInfo*/) {
     AEMU_SCOPED_TRACE("vkstubhal::ImportSemaphoreZirconHandleFUCHSIA");
     return VK_SUCCESS;
 }
 
-VkResult CreateBufferCollectionFUCHSIA(
-    VkDevice /*device*/,
-    const VkBufferCollectionCreateInfoFUCHSIA* /*pInfo*/,
-    const VkAllocationCallbacks* /*pAllocator*/,
-    VkBufferCollectionFUCHSIA* /*pCollection*/) {
+VkResult CreateBufferCollectionFUCHSIA(VkDevice /*device*/,
+                                       const VkBufferCollectionCreateInfoFUCHSIA* /*pInfo*/,
+                                       const VkAllocationCallbacks* /*pAllocator*/,
+                                       VkBufferCollectionFUCHSIA* /*pCollection*/) {
     AEMU_SCOPED_TRACE("vkstubhal::CreateBufferCollectionFUCHSIA");
     return VK_SUCCESS;
 }
 
-void DestroyBufferCollectionFUCHSIA(
-    VkDevice /*device*/,
-    VkBufferCollectionFUCHSIA /*collection*/,
-    const VkAllocationCallbacks* /*pAllocator*/) {
+void DestroyBufferCollectionFUCHSIA(VkDevice /*device*/, VkBufferCollectionFUCHSIA /*collection*/,
+                                    const VkAllocationCallbacks* /*pAllocator*/) {
     AEMU_SCOPED_TRACE("vkstubhal::DestroyBufferCollectionFUCHSIA");
 }
 
 VkResult SetBufferCollectionImageConstraintsFUCHSIA(
-    VkDevice /*device*/,
-    VkBufferCollectionFUCHSIA /*collection*/,
+    VkDevice /*device*/, VkBufferCollectionFUCHSIA /*collection*/,
     const VkImageConstraintsInfoFUCHSIA* /*pImageConstraintsInfo*/) {
     AEMU_SCOPED_TRACE("vkstubhal::SetBufferCollectionImageConstraintsFUCHSIA");
     return VK_SUCCESS;
 }
 
 VkResult SetBufferCollectionBufferConstraintsFUCHSIA(
-    VkDevice /*device*/,
-    VkBufferCollectionFUCHSIA /*collection*/,
+    VkDevice /*device*/, VkBufferCollectionFUCHSIA /*collection*/,
     const VkBufferConstraintsInfoFUCHSIA* /*pBufferConstraintsInfo*/) {
     AEMU_SCOPED_TRACE("vkstubhal::SetBufferCollectionBufferConstraintsFUCHSIA");
     return VK_SUCCESS;
 }
 
 VkResult GetBufferCollectionPropertiesFUCHSIA(
-    VkDevice /*device*/,
-    VkBufferCollectionFUCHSIA /*collection*/,
+    VkDevice /*device*/, VkBufferCollectionFUCHSIA /*collection*/,
     VkBufferCollectionPropertiesFUCHSIA* /*pProperties*/) {
     AEMU_SCOPED_TRACE("vkstubhal::GetBufferCollectionPropertiesFUCHSIA");
     return VK_SUCCESS;
 }
 #endif
 
-PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance,
-                                       const char* name) {
+PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const char* name) {
     AEMU_SCOPED_TRACE("vkstubhal::GetInstanceProcAddr");
     if (strcmp(name, "vkCreateInstance") == 0)
         return reinterpret_cast<PFN_vkVoidFunction>(CreateInstance);
     if (strcmp(name, "vkDestroyInstance") == 0)
         return reinterpret_cast<PFN_vkVoidFunction>(DestroyInstance);
     if (strcmp(name, "vkEnumerateInstanceExtensionProperties") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(
-            EnumerateInstanceExtensionProperties);
+        return reinterpret_cast<PFN_vkVoidFunction>(EnumerateInstanceExtensionProperties);
     if (strcmp(name, "vkEnumeratePhysicalDevices") == 0)
         return reinterpret_cast<PFN_vkVoidFunction>(EnumeratePhysicalDevices);
     if (strcmp(name, "vkEnumerateInstanceVersion") == 0)
         return reinterpret_cast<PFN_vkVoidFunction>(EnumerateInstanceVersion);
     if (strcmp(name, "vkEnumeratePhysicalDeviceGroups") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(
-            EnumeratePhysicalDeviceGroups);
+        return reinterpret_cast<PFN_vkVoidFunction>(EnumeratePhysicalDeviceGroups);
     if (strcmp(name, "vkEnumeratePhysicalDeviceGroupsKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(
-            EnumeratePhysicalDeviceGroups);
+        return reinterpret_cast<PFN_vkVoidFunction>(EnumeratePhysicalDeviceGroups);
     if (strcmp(name, "vkGetInstanceProcAddr") == 0)
         return reinterpret_cast<PFN_vkVoidFunction>(GetInstanceProcAddr);
     if (strcmp(name, "vkCreateDebugReportCallbackEXT") == 0)
@@ -282,20 +236,15 @@
     if (strcmp(name, "vkImportSemaphoreZirconHandleFUCHSIA") == 0)
         return reinterpret_cast<PFN_vkVoidFunction>(ImportSemaphoreZirconHandleFUCHSIA);
     if (strcmp(name, "vkCreateBufferCollectionFUCHSIA") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(
-            CreateBufferCollectionFUCHSIA);
+        return reinterpret_cast<PFN_vkVoidFunction>(CreateBufferCollectionFUCHSIA);
     if (strcmp(name, "vkDestroyBufferCollectionFUCHSIA") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(
-            DestroyBufferCollectionFUCHSIA);
+        return reinterpret_cast<PFN_vkVoidFunction>(DestroyBufferCollectionFUCHSIA);
     if (strcmp(name, "vkSetBufferCollectionImageConstraintsFUCHSIA") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(
-            SetBufferCollectionImageConstraintsFUCHSIA);
+        return reinterpret_cast<PFN_vkVoidFunction>(SetBufferCollectionImageConstraintsFUCHSIA);
     if (strcmp(name, "vkSetBufferCollectionBufferConstraintsFUCHSIA") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(
-            SetBufferCollectionBufferConstraintsFUCHSIA);
+        return reinterpret_cast<PFN_vkVoidFunction>(SetBufferCollectionBufferConstraintsFUCHSIA);
     if (strcmp(name, "vkGetBufferCollectionPropertiesFUCHSIA") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(
-            GetBufferCollectionPropertiesFUCHSIA);
+        return reinterpret_cast<PFN_vkVoidFunction>(GetBufferCollectionPropertiesFUCHSIA);
 #endif
     // Return NoOp for entrypoints that should never be called.
     if (strcmp(name, "vkGetPhysicalDeviceFeatures") == 0 ||
@@ -304,8 +253,7 @@
         strcmp(name, "vkGetPhysicalDeviceImageFormatProperties") == 0 ||
         strcmp(name, "vkGetPhysicalDeviceMemoryProperties") == 0 ||
         strcmp(name, "vkGetPhysicalDeviceQueueFamilyProperties") == 0 ||
-        strcmp(name, "vkGetDeviceProcAddr") == 0 ||
-        strcmp(name, "vkCreateDevice") == 0 ||
+        strcmp(name, "vkGetDeviceProcAddr") == 0 || strcmp(name, "vkCreateDevice") == 0 ||
         strcmp(name, "vkEnumerateDeviceExtensionProperties") == 0 ||
         strcmp(name, "vkGetPhysicalDeviceSparseImageFormatProperties") == 0 ||
         strcmp(name, "vkGetPhysicalDeviceFeatures2") == 0 ||
@@ -324,7 +272,7 @@
     return nullptr;
 }
 
-} // namespace vkstubhal
+}  // namespace vkstubhal
 
 namespace {
 
@@ -332,20 +280,19 @@
 
 int OpenDevice(const hw_module_t* module, const char* id, hw_device_t** device);
 
-hw_module_methods_t goldfish_vulkan_module_methods = {
-    .open = OpenDevice
-};
+hw_module_methods_t goldfish_vulkan_module_methods = {.open = OpenDevice};
 
 extern "C" __attribute__((visibility("default"))) hwvulkan_module_t HAL_MODULE_INFO_SYM = {
-    .common = {
-        .tag = HARDWARE_MODULE_TAG,
-        .module_api_version = HWVULKAN_MODULE_API_VERSION_0_1,
-        .hal_api_version = HARDWARE_HAL_API_VERSION,
-        .id = HWVULKAN_HARDWARE_MODULE_ID,
-        .name = "Goldfish Vulkan Driver",
-        .author = "The Android Open Source Project",
-        .methods = &goldfish_vulkan_module_methods,
-    },
+    .common =
+        {
+            .tag = HARDWARE_MODULE_TAG,
+            .module_api_version = HWVULKAN_MODULE_API_VERSION_0_1,
+            .hal_api_version = HARDWARE_HAL_API_VERSION,
+            .id = HWVULKAN_HARDWARE_MODULE_ID,
+            .name = "Goldfish Vulkan Driver",
+            .author = "The Android Open Source Project",
+            .methods = &goldfish_vulkan_module_methods,
+        },
 };
 
 int CloseDevice(struct hw_device_t* /*device*/) {
@@ -356,40 +303,38 @@
 
 #endif
 
-#define VK_HOST_CONNECTION(ret) \
-    HostConnection *hostCon = HostConnection::getOrCreate(VIRTIO_GPU_CAPSET_GFXSTREAM); \
-    if (!hostCon) { \
-        ALOGE("vulkan: Failed to get host connection\n"); \
-        return ret; \
-    } \
-    ExtendedRCEncoderContext *rcEnc = hostCon->rcEncoder(); \
-    if (!rcEnc) { \
-        ALOGE("vulkan: Failed to get renderControl encoder context\n"); \
-        return ret; \
-    } \
-    goldfish_vk::ResourceTracker::ThreadingCallbacks threadingCallbacks = { \
-        [] { \
-          auto hostCon = HostConnection::get(); \
-          hostCon->rcEncoder(); \
-          return hostCon; \
-        }, \
-        [](HostConnection* hostCon) { return hostCon->vkEncoder(); }, \
-    }; \
-    goldfish_vk::ResourceTracker::get()->setThreadingCallbacks(threadingCallbacks); \
-    goldfish_vk::ResourceTracker::get()->setupFeatures(rcEnc->featureInfo_const()); \
-    goldfish_vk::ResourceTracker::get()->setSeqnoPtr(getSeqnoPtrForProcess()); \
+#define VK_HOST_CONNECTION(ret)                                                          \
+    HostConnection* hostCon = HostConnection::getOrCreate(VIRTIO_GPU_CAPSET_GFXSTREAM);  \
+    if (!hostCon) {                                                                      \
+        ALOGE("vulkan: Failed to get host connection\n");                                \
+        return ret;                                                                      \
+    }                                                                                    \
+    ExtendedRCEncoderContext* rcEnc = hostCon->rcEncoder();                              \
+    if (!rcEnc) {                                                                        \
+        ALOGE("vulkan: Failed to get renderControl encoder context\n");                  \
+        return ret;                                                                      \
+    }                                                                                    \
+    goldfish_vk::ResourceTracker::ThreadingCallbacks threadingCallbacks = {              \
+        [] {                                                                             \
+            auto hostCon = HostConnection::get();                                        \
+            hostCon->rcEncoder();                                                        \
+            return hostCon;                                                              \
+        },                                                                               \
+        [](HostConnection* hostCon) { return hostCon->vkEncoder(); },                    \
+    };                                                                                   \
+    goldfish_vk::ResourceTracker::get()->setThreadingCallbacks(threadingCallbacks);      \
+    goldfish_vk::ResourceTracker::get()->setupFeatures(rcEnc->featureInfo_const());      \
+    goldfish_vk::ResourceTracker::get()->setSeqnoPtr(getSeqnoPtrForProcess());           \
     auto hostSupportsVulkan = goldfish_vk::ResourceTracker::get()->hostSupportsVulkan(); \
-    goldfish_vk::VkEncoder *vkEnc = hostCon->vkEncoder(); \
-    if (!vkEnc) { \
-        ALOGE("vulkan: Failed to get Vulkan encoder\n"); \
-        return ret; \
-    } \
+    goldfish_vk::VkEncoder* vkEnc = hostCon->vkEncoder();                                \
+    if (!vkEnc) {                                                                        \
+        ALOGE("vulkan: Failed to get Vulkan encoder\n");                                 \
+        return ret;                                                                      \
+    }
 
 VKAPI_ATTR
-VkResult EnumerateInstanceExtensionProperties(
-    const char* layer_name,
-    uint32_t* count,
-    VkExtensionProperties* properties) {
+VkResult EnumerateInstanceExtensionProperties(const char* layer_name, uint32_t* count,
+                                              VkExtensionProperties* properties) {
     AEMU_SCOPED_TRACE("goldfish_vulkan::EnumerateInstanceExtensionProperties");
 
     VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
@@ -413,8 +358,7 @@
 
 VKAPI_ATTR
 VkResult CreateInstance(const VkInstanceCreateInfo* create_info,
-                        const VkAllocationCallbacks* allocator,
-                        VkInstance* out_instance) {
+                        const VkAllocationCallbacks* allocator, VkInstance* out_instance) {
     AEMU_SCOPED_TRACE("goldfish_vulkan::CreateInstance");
 
     VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
@@ -430,10 +374,9 @@
 
 #ifdef VK_USE_PLATFORM_FUCHSIA
 VKAPI_ATTR
-VkResult GetMemoryZirconHandleFUCHSIA(
-    VkDevice device,
-    const VkMemoryGetZirconHandleInfoFUCHSIA* pInfo,
-    uint32_t* pHandle) {
+VkResult GetMemoryZirconHandleFUCHSIA(VkDevice device,
+                                      const VkMemoryGetZirconHandleInfoFUCHSIA* pInfo,
+                                      uint32_t* pHandle) {
     AEMU_SCOPED_TRACE("goldfish_vulkan::GetMemoryZirconHandleFUCHSIA");
 
     VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
@@ -442,41 +385,35 @@
         return vkstubhal::GetMemoryZirconHandleFUCHSIA(device, pInfo, pHandle);
     }
 
-    VkResult res = goldfish_vk::ResourceTracker::get()->
-        on_vkGetMemoryZirconHandleFUCHSIA(
-            vkEnc, VK_SUCCESS,
-            device, pInfo, pHandle);
+    VkResult res = goldfish_vk::ResourceTracker::get()->on_vkGetMemoryZirconHandleFUCHSIA(
+        vkEnc, VK_SUCCESS, device, pInfo, pHandle);
 
     return res;
 }
 
 VKAPI_ATTR
 VkResult GetMemoryZirconHandlePropertiesFUCHSIA(
-    VkDevice device,
-    VkExternalMemoryHandleTypeFlagBits handleType,
-    uint32_t handle,
+    VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, uint32_t handle,
     VkMemoryZirconHandlePropertiesFUCHSIA* pProperties) {
     AEMU_SCOPED_TRACE("goldfish_vulkan::GetMemoryZirconHandlePropertiesFUCHSIA");
 
     VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
 
     if (!hostSupportsVulkan) {
-        return vkstubhal::GetMemoryZirconHandlePropertiesFUCHSIA(
-            device, handleType, handle, pProperties);
+        return vkstubhal::GetMemoryZirconHandlePropertiesFUCHSIA(device, handleType, handle,
+                                                                 pProperties);
     }
 
-    VkResult res = goldfish_vk::ResourceTracker::get()->
-        on_vkGetMemoryZirconHandlePropertiesFUCHSIA(
-            vkEnc, VK_SUCCESS, device, handleType, handle, pProperties);
+    VkResult res = goldfish_vk::ResourceTracker::get()->on_vkGetMemoryZirconHandlePropertiesFUCHSIA(
+        vkEnc, VK_SUCCESS, device, handleType, handle, pProperties);
 
     return res;
 }
 
 VKAPI_ATTR
-VkResult GetSemaphoreZirconHandleFUCHSIA(
-    VkDevice device,
-    const VkSemaphoreGetZirconHandleInfoFUCHSIA* pInfo,
-    uint32_t* pHandle) {
+VkResult GetSemaphoreZirconHandleFUCHSIA(VkDevice device,
+                                         const VkSemaphoreGetZirconHandleInfoFUCHSIA* pInfo,
+                                         uint32_t* pHandle) {
     AEMU_SCOPED_TRACE("goldfish_vulkan::GetSemaphoreZirconHandleFUCHSIA");
 
     VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
@@ -485,17 +422,15 @@
         return vkstubhal::GetSemaphoreZirconHandleFUCHSIA(device, pInfo, pHandle);
     }
 
-    VkResult res = goldfish_vk::ResourceTracker::get()->
-        on_vkGetSemaphoreZirconHandleFUCHSIA(
-            vkEnc, VK_SUCCESS, device, pInfo, pHandle);
+    VkResult res = goldfish_vk::ResourceTracker::get()->on_vkGetSemaphoreZirconHandleFUCHSIA(
+        vkEnc, VK_SUCCESS, device, pInfo, pHandle);
 
     return res;
 }
 
 VKAPI_ATTR
-VkResult ImportSemaphoreZirconHandleFUCHSIA(
-    VkDevice device,
-    const VkImportSemaphoreZirconHandleInfoFUCHSIA* pInfo) {
+VkResult ImportSemaphoreZirconHandleFUCHSIA(VkDevice device,
+                                            const VkImportSemaphoreZirconHandleInfoFUCHSIA* pInfo) {
     AEMU_SCOPED_TRACE("goldfish_vulkan::ImportSemaphoreZirconHandleFUCHSIA");
 
     VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
@@ -504,46 +439,40 @@
         return vkstubhal::ImportSemaphoreZirconHandleFUCHSIA(device, pInfo);
     }
 
-    VkResult res = goldfish_vk::ResourceTracker::get()->
-        on_vkImportSemaphoreZirconHandleFUCHSIA(
-            vkEnc, VK_SUCCESS, device, pInfo);
+    VkResult res = goldfish_vk::ResourceTracker::get()->on_vkImportSemaphoreZirconHandleFUCHSIA(
+        vkEnc, VK_SUCCESS, device, pInfo);
 
     return res;
 }
 
 VKAPI_ATTR
-VkResult CreateBufferCollectionFUCHSIA(
-    VkDevice device,
-    const VkBufferCollectionCreateInfoFUCHSIA* pInfo,
-    const VkAllocationCallbacks* pAllocator,
-    VkBufferCollectionFUCHSIA* pCollection) {
+VkResult CreateBufferCollectionFUCHSIA(VkDevice device,
+                                       const VkBufferCollectionCreateInfoFUCHSIA* pInfo,
+                                       const VkAllocationCallbacks* pAllocator,
+                                       VkBufferCollectionFUCHSIA* pCollection) {
     AEMU_SCOPED_TRACE("goldfish_vulkan::CreateBufferCollectionFUCHSIA");
 
     VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
 
     if (!hostSupportsVulkan) {
-        return vkstubhal::CreateBufferCollectionFUCHSIA(
-            device, pInfo, pAllocator, pCollection);
+        return vkstubhal::CreateBufferCollectionFUCHSIA(device, pInfo, pAllocator, pCollection);
     }
 
-    VkResult res =
-        goldfish_vk::ResourceTracker::get()->on_vkCreateBufferCollectionFUCHSIA(
-            vkEnc, VK_SUCCESS, device, pInfo, pAllocator, pCollection);
+    VkResult res = goldfish_vk::ResourceTracker::get()->on_vkCreateBufferCollectionFUCHSIA(
+        vkEnc, VK_SUCCESS, device, pInfo, pAllocator, pCollection);
 
     return res;
 }
 
 VKAPI_ATTR
-void DestroyBufferCollectionFUCHSIA(VkDevice device,
-                                    VkBufferCollectionFUCHSIA collection,
+void DestroyBufferCollectionFUCHSIA(VkDevice device, VkBufferCollectionFUCHSIA collection,
                                     const VkAllocationCallbacks* pAllocator) {
     AEMU_SCOPED_TRACE("goldfish_vulkan::DestroyBufferCollectionFUCHSIA");
 
     VK_HOST_CONNECTION()
 
     if (!hostSupportsVulkan) {
-        vkstubhal::DestroyBufferCollectionFUCHSIA(device, collection,
-                                                  pAllocator);
+        vkstubhal::DestroyBufferCollectionFUCHSIA(device, collection, pAllocator);
         return;
     }
 
@@ -553,67 +482,57 @@
 
 VKAPI_ATTR
 VkResult SetBufferCollectionBufferConstraintsFUCHSIA(
-    VkDevice device,
-    VkBufferCollectionFUCHSIA collection,
+    VkDevice device, VkBufferCollectionFUCHSIA collection,
     const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo) {
-    AEMU_SCOPED_TRACE(
-        "goldfish_vulkan::SetBufferCollectionBufferConstraintsFUCHSIA");
+    AEMU_SCOPED_TRACE("goldfish_vulkan::SetBufferCollectionBufferConstraintsFUCHSIA");
 
     VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
 
     if (!hostSupportsVulkan) {
-        return vkstubhal::SetBufferCollectionBufferConstraintsFUCHSIA(
-            device, collection, pBufferConstraintsInfo);
+        return vkstubhal::SetBufferCollectionBufferConstraintsFUCHSIA(device, collection,
+                                                                      pBufferConstraintsInfo);
     }
 
     VkResult res =
-        goldfish_vk::ResourceTracker::get()
-            ->on_vkSetBufferCollectionBufferConstraintsFUCHSIA(
-                vkEnc, VK_SUCCESS, device, collection, pBufferConstraintsInfo);
+        goldfish_vk::ResourceTracker::get()->on_vkSetBufferCollectionBufferConstraintsFUCHSIA(
+            vkEnc, VK_SUCCESS, device, collection, pBufferConstraintsInfo);
 
     return res;
 }
 
 VKAPI_ATTR
 VkResult SetBufferCollectionImageConstraintsFUCHSIA(
-    VkDevice device,
-    VkBufferCollectionFUCHSIA collection,
+    VkDevice device, VkBufferCollectionFUCHSIA collection,
     const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo) {
-    AEMU_SCOPED_TRACE(
-        "goldfish_vulkan::SetBufferCollectionBufferConstraintsFUCHSIA");
+    AEMU_SCOPED_TRACE("goldfish_vulkan::SetBufferCollectionBufferConstraintsFUCHSIA");
 
     VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
 
     if (!hostSupportsVulkan) {
-        return vkstubhal::SetBufferCollectionImageConstraintsFUCHSIA(
-            device, collection, pImageConstraintsInfo);
+        return vkstubhal::SetBufferCollectionImageConstraintsFUCHSIA(device, collection,
+                                                                     pImageConstraintsInfo);
     }
 
     VkResult res =
-        goldfish_vk::ResourceTracker::get()
-            ->on_vkSetBufferCollectionImageConstraintsFUCHSIA(
-                vkEnc, VK_SUCCESS, device, collection, pImageConstraintsInfo);
+        goldfish_vk::ResourceTracker::get()->on_vkSetBufferCollectionImageConstraintsFUCHSIA(
+            vkEnc, VK_SUCCESS, device, collection, pImageConstraintsInfo);
 
     return res;
 }
 
 VKAPI_ATTR
-VkResult GetBufferCollectionPropertiesFUCHSIA(
-    VkDevice device,
-    VkBufferCollectionFUCHSIA collection,
-    VkBufferCollectionPropertiesFUCHSIA* pProperties) {
+VkResult GetBufferCollectionPropertiesFUCHSIA(VkDevice device, VkBufferCollectionFUCHSIA collection,
+                                              VkBufferCollectionPropertiesFUCHSIA* pProperties) {
     AEMU_SCOPED_TRACE("goldfish_vulkan::GetBufferCollectionPropertiesFUCHSIA");
 
     VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
 
     if (!hostSupportsVulkan) {
-        return vkstubhal::GetBufferCollectionPropertiesFUCHSIA(
-            device, collection, pProperties);
+        return vkstubhal::GetBufferCollectionPropertiesFUCHSIA(device, collection, pProperties);
     }
 
-    VkResult res = goldfish_vk::ResourceTracker::get()
-                       ->on_vkGetBufferCollectionPropertiesFUCHSIA(
-                           vkEnc, VK_SUCCESS, device, collection, pProperties);
+    VkResult res = goldfish_vk::ResourceTracker::get()->on_vkGetBufferCollectionPropertiesFUCHSIA(
+        vkEnc, VK_SUCCESS, device, collection, pProperties);
 
     return res;
 }
@@ -659,16 +578,12 @@
 static PFN_vkVoidFunction sQueueSignalReleaseImageAndroidImpl = 0;
 
 #ifdef VK_USE_PLATFORM_ANDROID_KHR
-static VkResult
-QueueSignalReleaseImageANDROID(
-    VkQueue queue,
-    uint32_t waitSemaphoreCount,
-    const VkSemaphore* pWaitSemaphores,
-    VkImage image,
-    int* pNativeFenceFd)
-{
+static VkResult QueueSignalReleaseImageANDROID(VkQueue queue, uint32_t waitSemaphoreCount,
+                                               const VkSemaphore* pWaitSemaphores, VkImage image,
+                                               int* pNativeFenceFd) {
     sFrameTracingState.onSwapBuffersSuccessful(HostConnection::get()->rcEncoder());
-    ((PFN_vkQueueSignalReleaseImageANDROID)sQueueSignalReleaseImageAndroidImpl)(queue, waitSemaphoreCount, pWaitSemaphores, image, pNativeFenceFd);
+    ((PFN_vkQueueSignalReleaseImageANDROID)sQueueSignalReleaseImageAndroidImpl)(
+        queue, waitSemaphoreCount, pWaitSemaphores, image, pNativeFenceFd);
     return VK_SUCCESS;
 }
 #endif
@@ -715,8 +630,8 @@
     if (!strcmp(name, "vkQueueSignalReleaseImageANDROID")) {
         if (!sQueueSignalReleaseImageAndroidImpl) {
             sQueueSignalReleaseImageAndroidImpl =
-                (PFN_vkVoidFunction)(
-                    goldfish_vk::goldfish_vulkan_get_device_proc_address(device, "vkQueueSignalReleaseImageANDROID"));
+                (PFN_vkVoidFunction)(goldfish_vk::goldfish_vulkan_get_device_proc_address(
+                    device, "vkQueueSignalReleaseImageANDROID"));
         }
         return (PFN_vkVoidFunction)QueueSignalReleaseImageANDROID;
     }
@@ -750,32 +665,32 @@
     if (!strcmp(name, "vkQueueSignalReleaseImageANDROID")) {
         if (!sQueueSignalReleaseImageAndroidImpl) {
             sQueueSignalReleaseImageAndroidImpl =
-                (PFN_vkVoidFunction)(
-                    goldfish_vk::goldfish_vulkan_get_instance_proc_address(instance, "vkQueueSignalReleaseImageANDROID"));
+                (PFN_vkVoidFunction)(goldfish_vk::goldfish_vulkan_get_instance_proc_address(
+                    instance, "vkQueueSignalReleaseImageANDROID"));
         }
         return (PFN_vkVoidFunction)QueueSignalReleaseImageANDROID;
     }
 #endif
-    return (PFN_vkVoidFunction)(goldfish_vk::goldfish_vulkan_get_instance_proc_address(instance, name));
+    return (
+        PFN_vkVoidFunction)(goldfish_vk::goldfish_vulkan_get_instance_proc_address(instance, name));
 }
 
 #ifdef VK_USE_PLATFORM_ANDROID_KHR
 
 hwvulkan_device_t goldfish_vulkan_device = {
-    .common = {
-        .tag = HARDWARE_DEVICE_TAG,
-        .version = HWVULKAN_DEVICE_API_VERSION_0_1,
-        .module = &HAL_MODULE_INFO_SYM.common,
-        .close = CloseDevice,
-    },
+    .common =
+        {
+            .tag = HARDWARE_DEVICE_TAG,
+            .version = HWVULKAN_DEVICE_API_VERSION_0_1,
+            .module = &HAL_MODULE_INFO_SYM.common,
+            .close = CloseDevice,
+        },
     .EnumerateInstanceExtensionProperties = EnumerateInstanceExtensionProperties,
     .CreateInstance = CreateInstance,
     .GetInstanceProcAddr = GetInstanceProcAddr,
 };
 
-int OpenDevice(const hw_module_t* /*module*/,
-               const char* id,
-               hw_device_t** device) {
+int OpenDevice(const hw_module_t* /*module*/, const char* id, hw_device_t** device) {
     AEMU_SCOPED_TRACE("goldfish_vulkan::OpenDevice");
 
     if (strcmp(id, HWVULKAN_DEVICE_0) == 0) {
@@ -789,7 +704,7 @@
 #elif VK_USE_PLATFORM_FUCHSIA
 
 class VulkanDevice {
-public:
+   public:
     VulkanDevice() : mHostSupportsGoldfish(IsAccessible(QEMU_PIPE_PATH)) {
         InitLogger();
         InitTraceProvider();
@@ -800,17 +715,14 @@
 
     static bool IsAccessible(const char* name) {
         zx_handle_t handle = GetConnectToServiceFunction()(name);
-        if (handle == ZX_HANDLE_INVALID)
-            return false;
+        if (handle == ZX_HANDLE_INVALID) return false;
 
         zxio_storage_t io_storage;
         zx_status_t status = zxio_create(handle, &io_storage);
-        if (status != ZX_OK)
-            return false;
+        if (status != ZX_OK) return false;
 
         status = zxio_close(&io_storage.io, /*should_wait=*/true);
-        if (status != ZX_OK)
-            return false;
+        if (status != ZX_OK) return false;
 
         return true;
     }
@@ -827,7 +739,7 @@
         return ::GetInstanceProcAddr(instance, name);
     }
 
-private:
+   private:
     void InitTraceProvider();
 
     TraceProviderFuchsia mTraceProvider;
@@ -835,35 +747,31 @@
 };
 
 void VulkanDevice::InitLogger() {
-  auto log_socket = ([] () -> std::optional<zx::socket> {
-    fidl::ClientEnd<fuchsia_logger::LogSink> channel{zx::channel{
-      GetConnectToServiceFunction()("/svc/fuchsia.logger.LogSink")}};
-    if (!channel.is_valid())
-      return std::nullopt;
+    auto log_socket = ([]() -> std::optional<zx::socket> {
+        fidl::ClientEnd<fuchsia_logger::LogSink> channel{
+            zx::channel{GetConnectToServiceFunction()("/svc/fuchsia.logger.LogSink")}};
+        if (!channel.is_valid()) return std::nullopt;
 
-    zx::socket local_socket, remote_socket;
-    zx_status_t status = zx::socket::create(ZX_SOCKET_DATAGRAM, &local_socket, &remote_socket);
-    if (status != ZX_OK)
-      return std::nullopt;
+        zx::socket local_socket, remote_socket;
+        zx_status_t status = zx::socket::create(ZX_SOCKET_DATAGRAM, &local_socket, &remote_socket);
+        if (status != ZX_OK) return std::nullopt;
 
-    auto result = fidl::WireCall(channel)->Connect(std::move(remote_socket));
+        auto result = fidl::WireCall(channel)->Connect(std::move(remote_socket));
 
-    if (!result.ok())
-      return std::nullopt;
+        if (!result.ok()) return std::nullopt;
 
-    return local_socket;
-  })();
-  if (!log_socket)
-    return;
+        return local_socket;
+    })();
+    if (!log_socket) return;
 
-  fx_logger_config_t config = {
-      .min_severity = FX_LOG_INFO,
-      .log_sink_socket = log_socket->release(),
-      .tags = nullptr,
-      .num_tags = 0,
-  };
+    fx_logger_config_t config = {
+        .min_severity = FX_LOG_INFO,
+        .log_sink_socket = log_socket->release(),
+        .tags = nullptr,
+        .num_tags = 0,
+    };
 
-  fx_log_reconfigure(&config);
+    fx_log_reconfigure(&config);
 }
 
 void VulkanDevice::InitTraceProvider() {
@@ -872,18 +780,18 @@
     }
 }
 
-extern "C" __attribute__((visibility("default"))) PFN_vkVoidFunction
-vk_icdGetInstanceProcAddr(VkInstance instance, const char* name) {
+extern "C" __attribute__((visibility("default"))) PFN_vkVoidFunction vk_icdGetInstanceProcAddr(
+    VkInstance instance, const char* name) {
     return VulkanDevice::GetInstance().GetInstanceProcAddr(instance, name);
 }
 
-extern "C" __attribute__((visibility("default"))) VkResult
-vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t* pSupportedVersion) {
+extern "C" __attribute__((visibility("default"))) VkResult vk_icdNegotiateLoaderICDInterfaceVersion(
+    uint32_t* pSupportedVersion) {
     *pSupportedVersion = std::min(*pSupportedVersion, 3u);
     return VK_SUCCESS;
 }
 
-typedef VkResult(VKAPI_PTR *PFN_vkOpenInNamespaceAddr)(const char *pName, uint32_t handle);
+typedef VkResult(VKAPI_PTR* PFN_vkOpenInNamespaceAddr)(const char* pName, uint32_t handle);
 
 namespace {
 
@@ -903,20 +811,18 @@
     return local_endpoint.release();
 }
 
-}
+}  // namespace
 
-extern "C" __attribute__((visibility("default"))) void
-vk_icdInitializeOpenInNamespaceCallback(PFN_vkOpenInNamespaceAddr callback) {
+extern "C" __attribute__((visibility("default"))) void vk_icdInitializeOpenInNamespaceCallback(
+    PFN_vkOpenInNamespaceAddr callback) {
     g_vulkan_connector = callback;
     SetConnectToServiceFunction(&LocalConnectToServiceFunction);
 }
 
 #else
 class VulkanDevice {
-public:
-    VulkanDevice() {
-        goldfish_vk::ResourceTracker::get();
-    }
+   public:
+    VulkanDevice() { goldfish_vk::ResourceTracker::get(); }
 
     static VulkanDevice& GetInstance() {
         static VulkanDevice g_instance;
@@ -928,17 +834,17 @@
     }
 };
 
-extern "C" __attribute__((visibility("default"))) PFN_vkVoidFunction
-vk_icdGetInstanceProcAddr(VkInstance instance, const char* name) {
+extern "C" __attribute__((visibility("default"))) PFN_vkVoidFunction vk_icdGetInstanceProcAddr(
+    VkInstance instance, const char* name) {
     return VulkanDevice::GetInstance().GetInstanceProcAddr(instance, name);
 }
 
-extern "C" __attribute__((visibility("default"))) VkResult
-vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t* pSupportedVersion) {
+extern "C" __attribute__((visibility("default"))) VkResult vk_icdNegotiateLoaderICDInterfaceVersion(
+    uint32_t* pSupportedVersion) {
     *pSupportedVersion = std::min(*pSupportedVersion, 3u);
     return VK_SUCCESS;
 }
 
 #endif
 
-} // namespace
+}  // namespace