summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorT.J. Mercier <tjmercier@google.com>2024-03-27 23:40:43 +0000
committerT.J. Mercier <tjmercier@google.com>2024-04-08 21:15:48 +0000
commit44eb705480fe7b134d6178746d5430ced247bc74 (patch)
tree7dba36dc6e003a790e52377bb95866816af045e4
parentbc3476d5dc6fed6fe8401144df5486fa7174ecd2 (diff)
downloadcore-44eb705480fe7b134d6178746d5430ced247bc74.tar.gz
Fix unused params and remove unneeded cflags
We already get -Wall and -Werror from the build system, and we do not want/need -Wexit-time-destructors since it prevents local statics with non-trivial destructors. Test: m Change-Id: I8283bf223404d6c253861d3888c1b720c099386e
-rw-r--r--libprocessgroup/Android.bp6
-rw-r--r--libprocessgroup/task_profiles.h8
-rw-r--r--libprocessgroup/task_profiles_test.cpp7
3 files changed, 7 insertions, 14 deletions
diff --git a/libprocessgroup/Android.bp b/libprocessgroup/Android.bp
index c6a073789..ca2e0ec7f 100644
--- a/libprocessgroup/Android.bp
+++ b/libprocessgroup/Android.bp
@@ -5,12 +5,6 @@ package {
cc_defaults {
name: "libprocessgroup_defaults",
cpp_std: "gnu++20",
- cflags: [
- "-Wall",
- "-Werror",
- "-Wexit-time-destructors",
- "-Wno-unused-parameter",
- ],
}
cc_library_headers {
diff --git a/libprocessgroup/task_profiles.h b/libprocessgroup/task_profiles.h
index 2fa193177..428447106 100644
--- a/libprocessgroup/task_profiles.h
+++ b/libprocessgroup/task_profiles.h
@@ -82,8 +82,8 @@ class ProfileAction {
virtual void EnableResourceCaching(ResourceCacheType) {}
virtual void DropResourceCaching(ResourceCacheType) {}
- virtual bool IsValidForProcess(uid_t uid, pid_t pid) const { return false; }
- virtual bool IsValidForTask(pid_t tid) const { return false; }
+ virtual bool IsValidForProcess(uid_t, pid_t) const { return false; }
+ virtual bool IsValidForTask(pid_t) const { return false; }
protected:
enum CacheUseResult { SUCCESS, FAIL, UNUSED };
@@ -109,8 +109,8 @@ class SetTimerSlackAction : public ProfileAction {
const char* Name() const override { return "SetTimerSlack"; }
bool ExecuteForTask(pid_t tid) const override;
- bool IsValidForProcess(uid_t uid, pid_t pid) const override { return true; }
- bool IsValidForTask(pid_t tid) const override { return true; }
+ bool IsValidForProcess(uid_t, pid_t) const override { return true; }
+ bool IsValidForTask(pid_t) const override { return true; }
private:
unsigned long slack_;
diff --git a/libprocessgroup/task_profiles_test.cpp b/libprocessgroup/task_profiles_test.cpp
index b17e695e5..d19da2b54 100644
--- a/libprocessgroup/task_profiles_test.cpp
+++ b/libprocessgroup/task_profiles_test.cpp
@@ -102,8 +102,7 @@ class ProfileAttributeMock : public IProfileAttribute {
public:
ProfileAttributeMock(const std::string& file_name) : file_name_(file_name) {}
~ProfileAttributeMock() override = default;
- void Reset(const CgroupController& controller, const std::string& file_name,
- const std::string& file_v2_name) override {
+ void Reset(const CgroupController&, const std::string&, const std::string&) override {
CHECK(false);
}
const CgroupController* controller() const override {
@@ -111,10 +110,10 @@ class ProfileAttributeMock : public IProfileAttribute {
return {};
}
const std::string& file_name() const override { return file_name_; }
- bool GetPathForProcess(uid_t uid, pid_t pid, std::string* path) const override {
+ bool GetPathForProcess(uid_t, pid_t pid, std::string* path) const override {
return GetPathForTask(pid, path);
}
- bool GetPathForTask(int tid, std::string* path) const override {
+ bool GetPathForTask(int, std::string* path) const override {
#ifdef __ANDROID__
CHECK(CgroupGetControllerPath(CGROUPV2_HIERARCHY_NAME, path));
CHECK_GT(path->length(), 0);