diff options
author | Daniel Zheng <zhengdaniel@google.com> | 2024-01-23 15:12:33 -0800 |
---|---|---|
committer | Daniel Zheng <zhengdaniel@google.com> | 2024-01-29 20:24:17 +0000 |
commit | 17be0f93a8bbc1436df6c52824b9e59c4d32f806 (patch) | |
tree | 752c50326cb486d259f28087c0e2d0c44daec8cd | |
parent | 7ff60fd8dcd64f5dd3574da2ccda20eb2f2d2870 (diff) | |
download | update_engine-17be0f93a8bbc1436df6c52824b9e59c4d32f806.tar.gz |
update_engine: remove unused variable
Count is never used in this function.
Test: th
Change-Id: I4987f0268e560eb1a7f5fa9ba9446603dcbf7193
-rw-r--r-- | aosp/ota_extractor.cc | 2 | ||||
-rw-r--r-- | payload_consumer/install_operation_executor.cc | 3 | ||||
-rw-r--r-- | payload_consumer/install_operation_executor.h | 4 | ||||
-rw-r--r-- | payload_consumer/install_operation_executor_unittest.cc | 11 | ||||
-rw-r--r-- | payload_consumer/partition_writer.cc | 2 | ||||
-rw-r--r-- | payload_consumer/vabc_partition_writer.cc | 2 |
6 files changed, 14 insertions, 10 deletions
diff --git a/aosp/ota_extractor.cc b/aosp/ota_extractor.cc index 4a57370f..713cfc35 100644 --- a/aosp/ota_extractor.cc +++ b/aosp/ota_extractor.cc @@ -163,7 +163,7 @@ bool ExtractImagesFromOTA(const DeltaArchiveManifest& manifest, op.type() == InstallOperation::REPLACE_BZ || op.type() == InstallOperation::REPLACE_XZ) { TEST_AND_RETURN_FALSE(executor.ExecuteReplaceOperation( - op, std::move(direct_writer), blob.data(), blob.size())); + op, std::move(direct_writer), blob.data())); } else if (op.type() == InstallOperation::SOURCE_COPY) { CHECK(in_fd->IsOpen()); TEST_AND_RETURN_FALSE(executor.ExecuteSourceCopyOperation( diff --git a/payload_consumer/install_operation_executor.cc b/payload_consumer/install_operation_executor.cc index cd6546f4..73ca8790 100644 --- a/payload_consumer/install_operation_executor.cc +++ b/payload_consumer/install_operation_executor.cc @@ -178,8 +178,7 @@ class PuffinExtentStream : public puffin::StreamInterface { bool InstallOperationExecutor::ExecuteReplaceOperation( const InstallOperation& operation, std::unique_ptr<ExtentWriter> writer, - const void* data, - size_t count) { + const void* data) { TEST_AND_RETURN_FALSE(operation.type() == InstallOperation::REPLACE || operation.type() == InstallOperation::REPLACE_BZ || operation.type() == InstallOperation::REPLACE_XZ); diff --git a/payload_consumer/install_operation_executor.h b/payload_consumer/install_operation_executor.h index 6c84fafa..85af3ba4 100644 --- a/payload_consumer/install_operation_executor.h +++ b/payload_consumer/install_operation_executor.h @@ -30,10 +30,10 @@ class InstallOperationExecutor { explicit InstallOperationExecutor(size_t block_size) : block_size_(block_size) {} + // data should point to the memory of operation.data_length() bytes bool ExecuteReplaceOperation(const InstallOperation& operation, std::unique_ptr<ExtentWriter> writer, - const void* data, - size_t count); + const void* data); bool ExecuteZeroOrDiscardOperation(const InstallOperation& operation, std::unique_ptr<ExtentWriter> writer); bool ExecuteSourceCopyOperation(const InstallOperation& operation, diff --git a/payload_consumer/install_operation_executor_unittest.cc b/payload_consumer/install_operation_executor_unittest.cc index 705d8f84..78aa31ef 100644 --- a/payload_consumer/install_operation_executor_unittest.cc +++ b/payload_consumer/install_operation_executor_unittest.cc @@ -150,7 +150,7 @@ TEST_F(InstallOperationExecutorTest, ReplaceOpTest) { } auto writer = std::make_unique<DirectExtentWriter>(target_fd_); ASSERT_TRUE(executor_.ExecuteReplaceOperation( - op, std::move(writer), expected_data.data(), expected_data.size())); + op, std::move(writer), expected_data.data())); brillo::Blob actual_data; utils::ReadExtents( @@ -237,8 +237,13 @@ TEST_F(InstallOperationExecutorTest, ZucchiniOpTest) { .version = PayloadVersion(kBrilloMajorPayloadVersion, kZucchiniMinorPayloadVersion)}; const FilesystemInterface::File empty; - diff_utils::BestDiffGenerator best_diff_generator( - source_data_, target_data_, src_extents, dst_extents, empty, empty, config); + diff_utils::BestDiffGenerator best_diff_generator(source_data_, + target_data_, + src_extents, + dst_extents, + empty, + empty, + config); std::vector<uint8_t> patch_data = target_data_; // Fake the full operation AnnotatedOperation aop; // Zucchini is enabled only on files with certain extensions diff --git a/payload_consumer/partition_writer.cc b/payload_consumer/partition_writer.cc index 2ec05f5e..e55722c0 100644 --- a/payload_consumer/partition_writer.cc +++ b/payload_consumer/partition_writer.cc @@ -190,7 +190,7 @@ bool PartitionWriter::PerformReplaceOperation(const InstallOperation& operation, // Setup the ExtentWriter stack based on the operation type. std::unique_ptr<ExtentWriter> writer = CreateBaseExtentWriter(); return install_op_executor_.ExecuteReplaceOperation( - operation, std::move(writer), data, count); + operation, std::move(writer), data); } bool PartitionWriter::PerformZeroOrDiscardOperation( diff --git a/payload_consumer/vabc_partition_writer.cc b/payload_consumer/vabc_partition_writer.cc index 1a7a049d..97de934f 100644 --- a/payload_consumer/vabc_partition_writer.cc +++ b/payload_consumer/vabc_partition_writer.cc @@ -344,7 +344,7 @@ bool VABCPartitionWriter::PerformReplaceOperation(const InstallOperation& op, // Setup the ExtentWriter stack based on the operation type. std::unique_ptr<ExtentWriter> writer = CreateBaseExtentWriter(); - return executor_.ExecuteReplaceOperation(op, std::move(writer), data, count); + return executor_.ExecuteReplaceOperation(op, std::move(writer), data); } bool VABCPartitionWriter::PerformDiffOperation( |