Skip to content

Commit

Permalink
gpt-utils: Drop -Wno-unused-variable and address one warning.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Tao Bao authored and Eamo5 committed Jul 7, 2020
1 parent 75937e7 commit 436a06c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion recovery/gpt-utils/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions recovery/gpt-utils/gpt-utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 436a06c

Please sign in to comment.