From ccf273d30774ce57c234112b98027f55c94bc1cb Mon Sep 17 00:00:00 2001 From: Aaqib Ismail Date: Thu, 14 Sep 2023 15:49:34 -0700 Subject: [PATCH] Fix clang lint warnings Bug: 291278377 Test: m Change-Id: Ifcfecc313c8d27fb04a20b4e6bf304b04f4a5b55 --- .../hardware/src/FakeVehicleHardware.cpp | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index 46c67a517a..661438516d 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -205,9 +204,10 @@ void FakeVehicleHardware::storePropInitialValue(const ConfigDeclaration& config) // Create a separate instance for each individual zone VehiclePropValue prop = { + .timestamp = elapsedRealtimeNano(), .areaId = curArea, .prop = propId, - .timestamp = elapsedRealtimeNano(), + .value = {}, }; if (config.initialAreaValues.empty()) { @@ -938,7 +938,7 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::getValue( << StringPrintf("failed to get special value: %d, error: %s", value.prop, getErrorMsg(result).c_str()); } else { - return std::move(result); + return result; } } @@ -953,7 +953,7 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::getValue( } } - return std::move(readResult); + return readResult; } DumpResult FakeVehicleHardware::dump(const std::vector& options) { @@ -1328,9 +1328,9 @@ std::string FakeVehicleHardware::genFakeDataCommand(const std::vector FakeVehicleHardware::getOptionValues( while (*index < options.size()) { std::string option = options[*index]; if (SET_PROP_OPTIONS.find(option) != SET_PROP_OPTIONS.end()) { - return std::move(values); + return values; } values.push_back(option); (*index)++; } - return std::move(values); + return values; } Result FakeVehicleHardware::parsePropOptions( @@ -1837,8 +1838,9 @@ StatusCode FakeVehicleHardware::updateSampleRate(int32_t propId, int32_t areaId, // Refresh the property value. In real implementation, this should poll the latest value // from vehicle bus. Here, we are just refreshing the existing value with a new timestamp. auto result = getValue(VehiclePropValue{ - .prop = propId, .areaId = areaId, + .prop = propId, + .value = {}, }); if (!result.ok()) { // Failed to read current value, skip refreshing.