Merge "Clean up the trivial uses of __attribute__((unused))." into ics-mr1-plus-art
diff --git a/src/dalvik_system_Zygote.cc b/src/dalvik_system_Zygote.cc
index 3f44109..c46f949 100644
--- a/src/dalvik_system_Zygote.cc
+++ b/src/dalvik_system_Zygote.cc
@@ -175,8 +175,8 @@
   return 0;
 }
 
-static void SetCapabilities(int64_t __attribute__((unused)) permitted, int64_t __attribute__((unused)) effective) {
-#ifdef HAVE_ANDROID_OS
+#if defined(HAVE_ANDROID_OS)
+static void SetCapabilities(int64_t permitted, int64_t effective) {
   struct __user_cap_header_struct capheader;
   struct __user_cap_data_struct capdata;
 
@@ -192,8 +192,10 @@
   if (capset(&capheader, &capdata) != 0) {
     PLOG(FATAL) << "capset(" << permitted << ", " << effective << ") failed";
   }
-#endif /*HAVE_ANDROID_OS*/
 }
+#else
+static void SetCapabilities(int64_t, int64_t) {}
+#endif
 
 static void EnableDebugFeatures(uint32_t debug_flags) {
   // Must match values in dalvik.system.Zygote.
diff --git a/src/mutex.cc b/src/mutex.cc
index 01aeff4..b3cf946 100644
--- a/src/mutex.cc
+++ b/src/mutex.cc
@@ -27,9 +27,8 @@
 
 namespace art {
 
-static inline void CheckSafeToLockOrUnlock(MutexRank __attribute__((unused)) rank,
-                                           bool __attribute__((unused)) is_locking) {
-#ifndef NDEBUG
+#if !defined(NDBEUG)
+static inline void CheckSafeToLockOrUnlock(MutexRank rank, bool is_locking) {
   if (rank == -1) {
     return;
   }
@@ -37,17 +36,21 @@
   if (self != NULL) {
     self->CheckSafeToLockOrUnlock(rank, is_locking);
   }
-#endif
 }
+#else
+static inline void CheckSafeToLockOrUnlock(MutexRank, bool) {}
+#endif
 
-static inline void CheckSafeToWait(MutexRank __attribute__((unused)) rank) {
-#ifndef NDEBUG
+#if !defined(NDEBUG)
+static inline void CheckSafeToWait(MutexRank rank) {
   Thread* self = Thread::Current();
   if (self != NULL) {
     self->CheckSafeToWait(rank);
   }
-#endif
 }
+#else
+static inline void CheckSafeToWait(MutexRank) {}
+#endif
 
 Mutex::Mutex(const char* name, MutexRank rank) : name_(name), rank_(rank) {
   // Like Java, we use recursive mutexes.
diff --git a/src/object.h b/src/object.h
index 0a670ee..a609433 100644
--- a/src/object.h
+++ b/src/object.h
@@ -2332,8 +2332,8 @@
   return GetField32(OFFSET_OF_OBJECT_MEMBER(Method, method_dex_index_), false);
 }
 
-inline void Method::AssertPcIsWithinCode(uintptr_t __attribute__((unused)) pc) const {
-#ifndef NDEBUG
+#if !defined(NDEBUG)
+inline void Method::AssertPcIsWithinCode(uintptr_t pc) const {
   if (IsNative() || IsRuntimeMethod() || IsProxyMethod()) {
     return;
   }
@@ -2346,8 +2346,10 @@
       << " pc=" << std::hex << pc
       << " code=" << GetCode()
       << " size=" << GetCodeSize();
-#endif
 }
+#else
+inline void Method::AssertPcIsWithinCode(uintptr_t) const {}
+#endif
 
 inline String* Class::GetName() const {
   return GetFieldObject<String*>(OFFSET_OF_OBJECT_MEMBER(Class, name_), false);