taimen: 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
This commit is contained in:
Tao Bao
2018-06-08 13:29:47 -07:00
committed by Asriadi
parent d403404a41
commit c613e817e6
2 changed files with 2 additions and 4 deletions

View File

@@ -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

View File

@@ -51,7 +51,7 @@
#include <vector>
#include <string>
#define LOG_TAG "gpt-utils"
#include <cutils/log.h>
#include <log/log.h>
#include <cutils/properties.h>
#include "gpt-utils.h"
#include <endian.h>
@@ -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;