Revert "Fix vk_append_struct to add elements after the last one"

This reverts commit 589c957ec9924f86757067b9195480fc95b3877a.

Reason for revert: Emulator build break:

I0425 08:32:25.637401 139856603629312 process.py:43] In file included from /usr/local/google/home/lfy/emu/device/generic/goldfish-opengl/system/vulkan_enc/AndroidHardwareBuffer.cpp:19:
I0425 08:32:25.637607 139856603629312 process.py:43] /usr/local/google/home/lfy/emu/device/generic/goldfish-opengl/system/vulkan_enc/vk_util.h:229:7: error: no member named 'abort' in the global namespace
I0425 08:32:25.637734 139856603629312 process.py:43]     ::abort();  // crash on loops in the chain
I0425 08:32:25.637989 139856603629312 process.py:43]     ~~^
I0425 08:32:25.638082 139856603629312 process.py:43] 1 error generated.

Change-Id: I3c78c841c821d29fb5fbdad552adee567893b2ba
Merged-In: I61bc2011e51bc92a3fffcb36910d916092d3897d
Test: none
Bug: 131181334
diff --git a/system/vulkan_enc/vk_util.h b/system/vulkan_enc/vk_util.h
index a60d3d8..0c7f4b9 100644
--- a/system/vulkan_enc/vk_util.h
+++ b/system/vulkan_enc/vk_util.h
@@ -215,28 +215,11 @@
 }
 
 static inline vk_struct_common*
-vk_last_struct_chain(vk_struct_common* i)
-{
-    for (int n = 1000000; n > 0; --n) {
-        vk_struct_common* next = i->pNext;
-        if (next) {
-            i = next;
-        } else {
-            return i;
-        }
-    }
-
-    ::abort();  // crash on loops in the chain
-    return NULL;
-}
-
-static inline vk_struct_common*
 vk_append_struct(vk_struct_common* current, vk_struct_common* next)
 {
-    vk_struct_common* last = vk_last_struct_chain(current);
-    last->pNext = next;
-    next->pNext = nullptr;
-    return current;
+   current->pNext = next;
+   next->pNext = nullptr;
+   return next;
 }
 
 #endif /* VK_UTIL_H */