summaryrefslogtreecommitdiff
path: root/fastboot/fastboot.cpp
diff options
context:
space:
mode:
authorYi-Yo Chiang <yochiang@google.com>2021-03-25 01:14:52 +0800
committerYo Chiang <yochiang@google.com>2021-03-25 04:23:08 +0000
commitac4a136e59ccd4fbe6e96c95bb85a5292803706c (patch)
tree116a1e6e882b596385e69574732bbc5e9df3bb6a /fastboot/fastboot.cpp
parentc0c9e3059c505868de31e70f51b9c53557e51de8 (diff)
fastboot: Refactor bootimg_utils.cpp:mkbootimg()
Change mkbootimg() to return void, as we already have a |out| parameter. Bug: 183455415 Test: Presubmit Change-Id: I51439e273752ab9e21f8d7138e900ea55bdfdfc0
Diffstat (limited to 'fastboot/fastboot.cpp')
-rw-r--r--fastboot/fastboot.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index f720ddaa4..c946ba95e 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -523,10 +523,12 @@ static std::vector<char> LoadBootableImage(const std::string& kernel, const std:
fprintf(stderr,"creating boot image...\n");
std::vector<char> out;
- boot_img_hdr_v2* boot_image_data = mkbootimg(kernel_data, ramdisk_data, second_stage_data,
- dtb_data, g_base_addr, g_boot_img_hdr, &out);
+ mkbootimg(kernel_data, ramdisk_data, second_stage_data, dtb_data, g_base_addr, g_boot_img_hdr,
+ &out);
- if (!g_cmdline.empty()) bootimg_set_cmdline(boot_image_data, g_cmdline);
+ if (!g_cmdline.empty()) {
+ bootimg_set_cmdline(reinterpret_cast<boot_img_hdr_v2*>(out.data()), g_cmdline);
+ }
fprintf(stderr, "creating boot image - %zu bytes\n", out.size());
return out;
}