From 436a06ce5a04e744689683ec6522276e3604269c Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 8 Jun 2018 13:29:47 -0700 Subject: [PATCH] gpt-utils: Drop -Wno-unused-variable and address one warning. hardware/qcom/msm8998/gpt-utils/gpt-utils.cpp:750:17: error: unused variable 'ufs_dir_stat' [-Werror,-Wunused-variable] struct stat ufs_dir_stat; ^ hardware/qcom/msm8998/gpt-utils/gpt-utils.cpp:973:13: error: unused variable 'r' [-Werror,-Wunused-variable] int r, fd; ^ hardware/qcom/msm8998/gpt-utils/gpt-utils.cpp:973:16: error: unused variable 'fd' [-Werror,-Wunused-variable] int r, fd; ^ 3 errors generated. [ 22% 4/18] target C++: libgptutils <= hardware/qcom/msm8998/gpt-utils/gpt-utils.cpp In file included from hardware/qcom/msm8998/gpt-utils/gpt-utils.cpp:54: system/core/libcutils/include_vndk/cutils/log.h:38:2: warning: "Deprecated: don't include cutils/log.h, use either android/log.h or log/log.h" [-W#warnings] ^ 1 warning generated. Test: lunch aosp_walleye-userdebug && m -j libgptutils Change-Id: Ie3c33cc61fc62ac93ab0954a9e292b62cfcf9e03 --- recovery/gpt-utils/Android.mk | 2 +- recovery/gpt-utils/gpt-utils.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/recovery/gpt-utils/Android.mk b/recovery/gpt-utils/Android.mk index aa6a0d03b..8c83b8459 100644 --- a/recovery/gpt-utils/Android.mk +++ b/recovery/gpt-utils/Android.mk @@ -16,7 +16,7 @@ LOCAL_PATH := $(call my-dir) -gpt_utils_common_cflags := -Wall -Werror -Wno-unused-variable +gpt_utils_common_cflags := -Wall -Werror include $(CLEAR_VARS) LOCAL_SRC_FILES := gpt-utils.cpp diff --git a/recovery/gpt-utils/gpt-utils.cpp b/recovery/gpt-utils/gpt-utils.cpp index e4651c441..7f04f42be 100644 --- a/recovery/gpt-utils/gpt-utils.cpp +++ b/recovery/gpt-utils/gpt-utils.cpp @@ -51,7 +51,7 @@ #include #include #define LOG_TAG "gpt-utils" -#include +#include #include #include "gpt-utils.h" #include @@ -747,7 +747,6 @@ int prepare_partitions(enum boot_update_stage stage, const char *dev_path) enum gpt_state gpt_prim, gpt_second; enum boot_update_stage internal_stage; struct stat xbl_partition_stat; - struct stat ufs_dir_stat; if (!dev_path) { fprintf(stderr, "%s: Invalid dev_path\n", @@ -970,7 +969,6 @@ int add_lun_to_update_list(char *lun_path, struct update_data *dat) int prepare_boot_update(enum boot_update_stage stage) { - int r, fd; int is_ufs = gpt_utils_is_ufs_device(); struct stat ufs_dir_stat; struct update_data data;